Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/oauth2_server/resource_server.ts>Scope

A standards compliant implementation of an OAuth 2.0 authorization server with PKCE support.
Latest
class Scope
implements ScopeInterface
Re-export
import { Scope } from "https://deno.land/x/oauth2_server@0.12.0/resource_server.ts";

A basic implementation of scope.

Constructors

new
Scope(scope?: string)

Properties

private
optional
stringCache: string
private
tokens: Set<string>

Methods

add(scope: Scope | string): Scope

Adds all scope tokens in the passted in scope to this scope.

Deletes all scope tokens from this scope.

equals(scope: Scope | string): boolean

Checks that this scope is equal to the passed in scope.

has(scope: Scope | string): boolean

Checks that this scope has all scope tokens in the passed in scope.

remove(scope: Scope | string): Scope

Removes all scope tokens in the passed in scope from this scope.

toJSON(): string

Converts the scope to a JSON representation.

toString(): string

Converts the scope to a string representation.

[Symbol.iterator](): IterableIterator<string>

Static Methods

from(scope: Scope | string): Scope

Creates a new scope from a scope.

intersection(a: Scope | string, b: Scope | string): Scope

Creates a new scope with all scope tokens that are present in both scopes.

union(a: Scope | string, b: Scope | string): Scope

Creates a new scope with all scope tokens from both scopes.