UNPKG

3.73 kBTypeScriptView Raw
1export declare class ScopeSet {
2 /**
3 * Check if there are dup scopes in a given request
4 *
5 * @param cachedScopes
6 * @param scopes
7 */
8 static isIntersectingScopes(cachedScopes: Array<string>, scopes: Array<string>): boolean;
9 /**
10 * Check if a given scope is present in the request
11 *
12 * @param cachedScopes
13 * @param scopes
14 */
15 static containsScope(cachedScopes: Array<string>, scopes: Array<string>): boolean;
16 /**
17 * Trims and converts string to lower case
18 *
19 * @param scopes
20 */
21 static trimAndConvertToLowerCase(scope: string): string;
22 /**
23 * Performs trimAndConvertToLowerCase on string array
24 * @param scopes
25 */
26 static trimAndConvertArrayToLowerCase(scopes: Array<string>): Array<string>;
27 /**
28 * Trims each scope in scopes array
29 * @param scopes
30 */
31 static trimScopes(scopes: Array<string>): Array<string>;
32 /**
33 * Remove one element from a scope array
34 *
35 * @param scopes
36 * @param scope
37 */
38 static removeElement(scopes: Array<string>, scope: string): Array<string>;
39 /**
40 * Parse the scopes into a formatted scopeList
41 * @param scopes
42 */
43 static parseScope(scopes: Array<string>): string;
44 /**
45 * @hidden
46 *
47 * Used to validate the scopes input parameter requested by the developer.
48 * @param {Array<string>} scopes - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.
49 * @param {boolean} scopesRequired - Boolean indicating whether the scopes array is required or not
50 * @ignore
51 */
52 static validateInputScope(scopes: Array<string>, scopesRequired: boolean): void;
53 /**
54 * @hidden
55 *
56 * Extracts scope value from the state sent with the authentication request.
57 * @param {string} state
58 * @returns {string} scope.
59 * @ignore
60 */
61 static getScopeFromState(state: string): string;
62 /**
63 * @ignore
64 * Appends extraScopesToConsent if passed
65 * @param {@link AuthenticationParameters}
66 */
67 static appendScopes(reqScopes: Array<string>, reqExtraScopesToConsent: Array<string>): Array<string>;
68 /**
69 * @ignore
70 * Returns true if the scopes array only contains openid and/or profile
71 */
72 static onlyContainsOidcScopes(scopes: Array<string>): boolean;
73 /**
74 * @ignore
75 * Returns true if the scopes array only contains openid and/or profile
76 */
77 static containsAnyOidcScopes(scopes: Array<string>): boolean;
78 /**
79 * @ignore
80 * Returns true if the clientId is the only scope in the array
81 */
82 static onlyContainsClientId(scopes: Array<String>, clientId: string): boolean;
83 /**
84 * @ignore
85 * Adds missing OIDC scopes to scopes array without duplication. Since STS requires OIDC scopes for
86 * all implicit flow requests, 'openid' and 'profile' should always be included in the final request
87 */
88 static appendDefaultScopes(scopes: Array<string>): Array<string>;
89 /**
90 * @ignore
91 * Removes present OIDC scopes from scopes array.
92 */
93 static removeDefaultScopes(scopes: Array<string>): Array<string>;
94 /**
95 * @ignore
96 * Removes clientId from scopes array if included as only scope. If it's not the only scope, it is treated as a resource scope.
97 * @param scopes Array<string>: Pre-normalized scopes array
98 * @param clientId string: The application's clientId that is searched for in the scopes array
99 */
100 static translateClientIdIfSingleScope(scopes: Array<string>, clientId: string): Array<string>;
101}