Instances represent OAuth 2.0 scope.

An OAuth 2.0 token may optionally have authorization scopes. An authorization scope provides more granular authorization to protected resources. Without authorization scopes, any valid token can pass through an Authorizer.bearer. Scopes allow Authorizers to restrict access to routes that do not have the appropriate scope values.

An AuthClient has a list of valid scopes (see aqueduct auth tool). An access token issued for an AuthClient may ask for any of the scopes the client provides. Scopes are then granted to the access token. An Authorizer may specify a one or more required scopes that a token must have to pass to the next controller.

The format of scopeString is meant to be flexible; see constructor for details.

Constants

Any → List<AuthScope>

Signifies 'any' scope in AuthStorage.allowedScopesForAuthenticatable.

const [const AuthScope._("_scope:_constant:_marker", const [], null)]

Constructors

AuthScope(String scopeString)

Creates an instance of this type from scopeString.

factory

Properties

modifier → String

The modifier of this scope, if it exists.

read-only
scopeString → String

This instance as a string.

final
segments → Iterable<String>

Individual segments, separated by : character, of this instance.

read-only
hashCode → int

The hash code for this object.

read-only, inherited
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

allows(String scopeString) → bool

String variant of allowsScope.

allowsScope(AuthScope incomingScope) → bool

Whether or not incomingScope has at least the same scoping access as this instance.

isExactly(String scopeString) → bool

String variant of isExactlyScope.

isExactlyScope(AuthScope scope) → bool

Whether or not two scopes are exactly the same.

isSubsetOrEqualTo(AuthScope scope) → bool

Whether or not this instance is a subset or equal to scope.

toString() → String

Returns a string representation of this object.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited