Package org.azd.security
Class SecurityApi
- All Implemented Interfaces:
SecurityDetails
-
Constructor Summary
ConstructorDescriptionSecurityApi
(Connection connection) Pass the connection object to work with Security Api -
Method Summary
Modifier and TypeMethodDescriptiongetAccessControlLists
(String namespaceId) Return a list of access control lists for the specified security namespace and token.getAccessControlLists
(String namespaceId, String[] descriptors, String token, boolean includeExtendedInfo, boolean recurse) Return a list of access control lists for the specified security namespace and token.getIdentities
(String[] descriptors, String[] identityIds, String[] subjectDescriptors, String filterValue, String queryMembership, String searchFilter) Resolve legacy identity information for use with older APIs such as the Security APIsgetIdentitiesFromSubjectDescriptors
(String... subjectDescriptors) seegetIdentities(String[], String[], String[], String, String, String)
shortcut to provide var args list of subjectDescriptors onlygetNamespace
(String namespaceId) return a namespace with the specific identifierreturn all security namespaces, remote and localgetNamespaces
(boolean localOnly) return all security namespaces, remote and localremoveAccessControlEntries
(String namespaceId, String[] descriptors, String[] tokens) Remove the specified ACEs from the ACL belonging to the specified token.removeAccessControlLists
(String namespaceId, boolean recurse, String[] tokens) Remove access control lists under the specified security namespace.setAccessControlEntries
(String namespaceId, ACEs payload) Add or update ACEs in the ACL for the provided token.setAccessControlList
(String namespaceId, ACLs payload) Create or update one or more access control lists.Methods inherited from class org.azd.utils.AzDAsyncApi
createAsync
-
Constructor Details
-
SecurityApi
Pass the connection object to work with Security Api- Parameters:
connection
- Connection object
-
-
Method Details
-
getNamespaces
return all security namespaces, remote and localSecurity namespaces are used to store access control lists (ACLs) on tokens.
- Specified by:
getNamespaces
in interfaceSecurityDetails
- Returns:
- SecurityNamespaces
SecurityNamespaces
- Throws:
AzDException
- Default Api Exception handler.
-
getNamespaces
return all security namespaces, remote and localLocal vs. remote
- Security namespaces may have their data mastered in one microservice, but still be visible in other microservices.
- If a security namespace's data is mastered in microservice X, it is said to be local to that microservice. Otherwise, it is said to be remote.
- Specified by:
getNamespaces
in interfaceSecurityDetails
- Parameters:
localOnly
- whether to include only local or all namespaces- Returns:
- SecurityNamespaces
SecurityNamespaces
- Throws:
AzDException
- Default Api Exception handler.
-
getNamespace
return a namespace with the specific identifier- Specified by:
getNamespace
in interfaceSecurityDetails
- Parameters:
namespaceId
- namespace identifier- Returns:
- SecurityNamespace
SecurityNamespace
- Throws:
AzDException
- Default Api Exception handler.
-
getAccessControlLists
Return a list of access control lists for the specified security namespace and token. All ACLs in the security namespace will be retrieved if no optional parameters are provided.- Specified by:
getAccessControlLists
in interfaceSecurityDetails
- Parameters:
namespaceId
- identifier of namespace- Returns:
- ACLs
ACLs
- Throws:
AzDException
- Default Api Exception handler.
-
getAccessControlLists
public ACLs getAccessControlLists(String namespaceId, String[] descriptors, String token, boolean includeExtendedInfo, boolean recurse) throws AzDException Return a list of access control lists for the specified security namespace and token. All ACLs in the security namespace will be retrieved if no optional parameters are provided.- Specified by:
getAccessControlLists
in interfaceSecurityDetails
- Parameters:
namespaceId
- identifier of namespacedescriptors
- An optional filter string containing a list of identity descriptors separated by ',' whose ACEs should be retrieved. If this is left null, entire ACLs will be returned.token
- Security token. See Security namespace and permission reference for Azure DevOpsincludeExtendedInfo
- If true, populate the extended information properties for the access control entries contained in the returned lists.recurse
- If true and this is a hierarchical namespace, return child ACLs of the specified token.- Returns:
- ACLs
ACLs
- Throws:
AzDException
- Default Api Exception handler.
-
getIdentities
public Identities getIdentities(String[] descriptors, String[] identityIds, String[] subjectDescriptors, String filterValue, String queryMembership, String searchFilter) throws AzDException Resolve legacy identity information for use with older APIs such as the Security APIs- Specified by:
getIdentities
in interfaceSecurityDetails
- Parameters:
descriptors
- A list of identity descriptors to resolveidentityIds
- A list of storage keys to resolvesubjectDescriptors
- list of subject descriptors to resolvefilterValue
- The search value, as specified by the searchFilter.queryMembership
- The membership information to include with the identities. Values can be None for no membership data or Direct to include the groups that the identity is a member of and the identities that are a member of this identity (groups only)searchFilter
- The type of search to perform. Values can be AccountName (domain\alias), DisplayName, MailAddress, General (display name, account name, or unique name), or LocalGroupName (only search Azure Devops groups).- Returns:
- Identities
Identities
- Throws:
AzDException
- Default Api Exception handler.
-
getIdentitiesFromSubjectDescriptors
public Identities getIdentitiesFromSubjectDescriptors(String... subjectDescriptors) throws AzDException seegetIdentities(String[], String[], String[], String, String, String)
shortcut to provide var args list of subjectDescriptors only- Specified by:
getIdentitiesFromSubjectDescriptors
in interfaceSecurityDetails
- Parameters:
subjectDescriptors
- list of subject descriptors to resolve- Returns:
- Identities
Identities
- Throws:
AzDException
- Default Api Exception handler.
-
setAccessControlEntries
Add or update ACEs in the ACL for the provided token. The request body contains the target token, a list of ACEs and a optional merge parameter. In the case of a collision (by identity descriptor) with an existing ACE in the ACL, the "merge" parameter determines the behavior. If set, the existing ACE has its allow and deny merged with the incoming ACE's allow and deny. If unset, the existing ACE is displaced.- Specified by:
setAccessControlEntries
in interfaceSecurityDetails
- Parameters:
namespaceId
- Security namespace identifier.payload
- An array ofACEs
. Class for encapsulating the allowed and denied permissions for a given IdentityDescriptor.- Returns:
- ACEs
ACEs
- Throws:
AzDException
- Default Api Exception handler.
-
removeAccessControlEntries
public Void removeAccessControlEntries(String namespaceId, String[] descriptors, String[] tokens) throws AzDException Remove the specified ACEs from the ACL belonging to the specified token.- Specified by:
removeAccessControlEntries
in interfaceSecurityDetails
- Parameters:
namespaceId
- Security namespace identifier.descriptors
- A list of identity descriptors whose entries should be removed.tokens
- A list of tokens whose ACL should be modified.- Throws:
AzDException
- Default Api Exception handler.
-
setAccessControlList
Create or update one or more access control lists. All data that currently exists for the ACLs supplied will be overwritten.- Specified by:
setAccessControlList
in interfaceSecurityDetails
- Parameters:
namespaceId
- Security namespace identifier.payload
- ACLsACLs
- Throws:
AzDException
- Default Api Exception handler.
-
removeAccessControlLists
public Void removeAccessControlLists(String namespaceId, boolean recurse, String[] tokens) throws AzDException Remove access control lists under the specified security namespace.- Specified by:
removeAccessControlLists
in interfaceSecurityDetails
- Parameters:
namespaceId
- Security namespace identifier.recurse
- If true and this is a hierarchical namespace, also remove child ACLs of the specified tokens.tokens
- One or more comma-separated security tokens- Throws:
AzDException
- Default Api Exception handler.
-