-
Notifications
You must be signed in to change notification settings - Fork 315
feat: container temporary credentials #5965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
MMaiero
wants to merge
2
commits into
develop
Choose a base branch
from
feature/container-temporary-credentials
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+785
−8
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
70 changes: 70 additions & 0 deletions
70
...rg.eclipse.kura.api/src/main/java/org/eclipse/kura/identity/TemporaryIdentityService.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| /******************************************************************************* | ||
| * Copyright (c) 2025 Eurotech and/or its affiliates and others | ||
| * | ||
| * This program and the accompanying materials are made | ||
| * available under the terms of the Eclipse Public License 2.0 | ||
| * which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
| * | ||
| * SPDX-License-Identifier: EPL-2.0 | ||
| * | ||
| * Contributors: | ||
| * Eurotech | ||
| ******************************************************************************/ | ||
| package org.eclipse.kura.identity; | ||
|
|
||
| import java.util.Set; | ||
|
|
||
| import org.eclipse.kura.KuraException; | ||
| import org.osgi.annotation.versioning.ProviderType; | ||
|
|
||
| /** | ||
| * A service interface that allows to manage temporary Kura identities for containers. | ||
| * Temporary identities are not persisted and are automatically removed when no longer needed. | ||
| * | ||
| * @noimplement This interface is not intended to be implemented by clients. | ||
| * @since 2.8.0 | ||
| */ | ||
| @ProviderType | ||
| public interface TemporaryIdentityService { | ||
|
|
||
| /** | ||
| * Creates a temporary identity with the given name and permissions. | ||
| * The identity will not be persisted and will exist only in memory. | ||
| * | ||
| * @param identityName the name of the temporary identity to be created. | ||
| * @param permissions the set of permissions to be assigned to this temporary identity. | ||
| * @return a temporary authentication token that can be used to authenticate as this identity. | ||
| * @throws KuraException if a failure occurs in creating the temporary identity. | ||
| */ | ||
| public String createTemporaryIdentity(final String identityName, final Set<Permission> permissions) throws KuraException; | ||
|
|
||
| /** | ||
| * Deletes a temporary identity identified by its authentication token. | ||
| * | ||
| * @param token the authentication token of the temporary identity to be deleted. | ||
| * @return {@code true} if the temporary identity was deleted as part of the method call | ||
| * or {@code false} if the identity does not exist. | ||
| * @throws KuraException if a failure occurs in deleting the temporary identity. | ||
| */ | ||
| public boolean deleteTemporaryIdentity(final String token) throws KuraException; | ||
|
|
||
| /** | ||
| * Validates a temporary identity authentication token and returns the identity name. | ||
| * | ||
| * @param token the authentication token to validate. | ||
| * @return the identity name if the token is valid. | ||
| * @throws KuraException if the token is invalid or if a failure occurs during validation. | ||
| */ | ||
| public String validateTemporaryToken(final String token) throws KuraException; | ||
|
|
||
| /** | ||
| * Checks if the specified permission is currently assigned to the temporary identity | ||
| * identified by the given token. | ||
| * | ||
| * @param token the authentication token of the temporary identity. | ||
| * @param permission the permission to check. | ||
| * @throws KuraException if the provided permission is not currently assigned to | ||
| * the given temporary identity or if a failure occurs while performing the check. | ||
| */ | ||
| public void checkTemporaryPermission(final String token, final Permission permission) throws KuraException; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a typo in the method name. It should be "setContainerNetworkConfiguration" instead of "setContainerNetowrkConfiguration".