Package land.oras.auth
Class Scopes
java.lang.Object
land.oras.auth.Scopes
Store scopes
-
Method Summary
Modifier and TypeMethodDescriptionstatic Scopesempty(ContainerRef containerRef, String service) Create a new Scopes object with no scopesbooleanGet the container referenceGet the registryGet the scopes@Nullable StringGet the servicebooleanReturn if these scopes include global scopes (i.e. at least one scope that is not a repository or registry scope)inthashCode()booleanisGlobal()Return if these are global scopes (i.e. no repository or registry scopes) Typically AWS ECR uses global scopes for authentication, while Docker Hub uses repository scopes.booleanReturn if these are pull-only scopes (i.e. all scopes end with ":pull" and there are no global scopes)static Scopesof(String service, ContainerRef containerRef, Scope... scopes) Create a new Scopes objectstatic Scopesof(ContainerRef containerRef, Scope... scopes) Create a new Scopes objecttoString()withAddedGlobalScopes(String... globalScopes) Return a new copy of the Scopes object with the given scopeswithAddedRegistryScopes(Scope... newScopes) Return a new copy of the Scopes object with the added scopeswithNewScope(String scope) Return a new copy of the Scopes object with the given scopeReturn scopes that only contains global scopes (i.e. no repository or registry scopes)Return scopes that only contains non-global scopes (i.e. only repository or registry scopes)withRegistryScopes(Scope... scopes) Return a new copy of the Scopes object with the given scopeswithService(@Nullable String service) Return a new copy of the Scopes object with the given service
-
Method Details
-
of
Create a new Scopes object- Parameters:
containerRef- The container referencescopes- The scopes- Returns:
- A new Scopes object
-
of
Create a new Scopes object- Parameters:
service- The servicecontainerRef- The container referencescopes- The scopes- Returns:
- A new Scopes object
-
empty
Create a new Scopes object with no scopes- Parameters:
containerRef- The container referenceservice- The service- Returns:
- A new Scopes object with no scopes
-
withRegistryScopes
Return a new copy of the Scopes object with the given scopes- Parameters:
scopes- The scopes to set- Returns:
- A new Scopes object with the given scopes
-
withAddedRegistryScopes
Return a new copy of the Scopes object with the added scopes- Parameters:
newScopes- The scopes to add- Returns:
- A new Scopes object with the given scopes
-
withAddedGlobalScopes
Return a new copy of the Scopes object with the given scopes- Parameters:
globalScopes- The global scopes to add- Returns:
- A new Scopes object with the given scopes
-
withOnlyGlobalScopes
Return scopes that only contains global scopes (i.e. no repository or registry scopes)- Returns:
- A new Scopes object with only global scopes
-
withoutGlobalScopes
Return scopes that only contains non-global scopes (i.e. only repository or registry scopes)- Returns:
- A new Scopes object with only non-global scopes
-
withNewScope
Return a new copy of the Scopes object with the given scope- Parameters:
scope- The scope to add- Returns:
- A new Scopes object with the given scope
-
withService
Return a new copy of the Scopes object with the given service- Parameters:
service- The service to set- Returns:
- A new Scopes object with the given service
-
getService
Get the service- Returns:
- The service
-
getScopes
Get the scopes- Returns:
- The scopes
-
getRegistry
Get the registry- Returns:
- The registry
-
getContainerRef
Get the container reference- Returns:
- The container reference
-
isGlobal
public boolean isGlobal()Return if these are global scopes (i.e. no repository or registry scopes) Typically AWS ECR uses global scopes for authentication, while Docker Hub uses repository scopes.- Returns:
- True if these are global scopes, false otherwise
-
hasGlobalScopes
public boolean hasGlobalScopes()Return if these scopes include global scopes (i.e. at least one scope that is not a repository or registry scope)- Returns:
- True if these scopes include global scopes, false otherwise
-
isPullOnly
public boolean isPullOnly()Return if these are pull-only scopes (i.e. all scopes end with ":pull" and there are no global scopes)- Returns:
- True if these are pull-only scopes, false otherwise
-
equals
-
hashCode
public int hashCode() -
toString
-