@nsshunt/stsoauth2plugin 0.1.44 → 0.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/stsoauth2plugin.es.js +12309 -0
- package/package.json +13 -4
- package/.eslintrc.json +0 -27
- package/.github/dependabot.yml +0 -13
- package/.github/workflows/npm-publish.yml +0 -54
- package/babel.config.json +0 -6
- package/build.sh +0 -29
- package/dist/Utils/CryptoUtils.js +0 -32
- package/dist/Utils/CryptoUtils.js.map +0 -1
- package/dist/Utils/QueryParams.js +0 -49
- package/dist/Utils/QueryParams.js.map +0 -1
- package/dist/index.js +0 -11
- package/dist/index.js.map +0 -1
- package/dist/index.test.js +0 -8
- package/dist/index.test.js.map +0 -1
- package/dist/stsStorage.js +0 -152
- package/dist/stsStorage.js.map +0 -1
- package/dist/stsoauth2manager.js +0 -358
- package/dist/stsoauth2manager.js.map +0 -1
- package/dist/stsoauth2types.js +0 -31
- package/dist/stsoauth2types.js.map +0 -1
- package/dist/stsoauth2worker.js +0 -590
- package/dist/stsoauth2worker.js.map +0 -1
- package/package-vite.json +0 -58
- package/src/Utils/CryptoUtils.ts +0 -32
- package/src/Utils/QueryParams.ts +0 -48
- package/src/index.test.ts +0 -10
- package/src/index.ts +0 -13
- package/src/stsStorage.ts +0 -158
- package/src/stsoauth2manager.ts +0 -377
- package/src/stsoauth2types.ts +0 -133
- package/src/stsoauth2worker.ts +0 -587
- package/tsconfig.json +0 -32
- package/vite.config.ts +0 -62
package/src/stsoauth2types.ts
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
export enum AuthorizeOptionsResponseType {
|
|
2
|
-
CODE = 'code',
|
|
3
|
-
ID_TOKEN = 'id_token',
|
|
4
|
-
TOKEN = 'token'
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export enum AuthorizeOptionsResponseMode {
|
|
8
|
-
QUERY = 'query',
|
|
9
|
-
FRAGMENT = 'fragment',
|
|
10
|
-
FORM_POST = 'form_post'
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow
|
|
14
|
-
export interface IAuthorizeOptions {
|
|
15
|
-
client_id: string,
|
|
16
|
-
nonce: string,
|
|
17
|
-
response_type: AuthorizeOptionsResponseType[], // Must include: 'code' and may include: 'id_token' and/or 'token'
|
|
18
|
-
redirect_uri: string,
|
|
19
|
-
response_mode: AuthorizeOptionsResponseMode
|
|
20
|
-
scope: string, // A space-separated list of scopes that you want the user to consent to. For the /authorize leg of the request, this parameter can cover multiple resources. This value allows your app to get consent for multiple web APIs you want to call.
|
|
21
|
-
state: string, // Client application state (if required)
|
|
22
|
-
code_challenge: string,
|
|
23
|
-
code_challenge_method: string, //@@ enum S256
|
|
24
|
-
code_verifier?: string
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface IAuthorizeResponse {
|
|
28
|
-
state: string, // state passed to authorize end-point
|
|
29
|
-
code: string // authorization code
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface IAuthorizeErrorResponse {
|
|
33
|
-
error: string,
|
|
34
|
-
error_description: string
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export enum OAuthGrantTypes {
|
|
38
|
-
CLIENT_CREDENTIALS = 'client_credentials',
|
|
39
|
-
AUTHORIZATION_CODE = 'authorization_code',
|
|
40
|
-
REFRESH_TOKEN = 'refresh_token'
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface IAuthorizationCodeFlowParameters {
|
|
44
|
-
client_id: string,
|
|
45
|
-
scope: string,
|
|
46
|
-
code: string,
|
|
47
|
-
redirect_uri: string, // URI
|
|
48
|
-
grant_type: OAuthGrantTypes, // 'authorization_code', //@@ need enum
|
|
49
|
-
code_verifier: string
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface IRefreshFlowParameters {
|
|
53
|
-
client_id: string,
|
|
54
|
-
scope: string,
|
|
55
|
-
refresh_token: string, // JWT
|
|
56
|
-
grant_type: OAuthGrantTypes // 'refresh_token' //@@ enum
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface ITokenResponse {
|
|
60
|
-
access_token: string, // JWT
|
|
61
|
-
token_type: string, //@@ "Bearer" only
|
|
62
|
-
expires_in: number,
|
|
63
|
-
scope: string,
|
|
64
|
-
refresh_token: string, // JWT
|
|
65
|
-
id_token: string, // JWT
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface ITokenErrorResponse {
|
|
69
|
-
error: string,
|
|
70
|
-
error_description: string,
|
|
71
|
-
error_codes: number[],
|
|
72
|
-
timestamp: number
|
|
73
|
-
details: unknown //@@ STS attribute ?
|
|
74
|
-
//"trace_id": "255d1aef-8c98-452f-ac51-23d051240864", //@@ MS attribute
|
|
75
|
-
//"correlation_id": "fb3d2015-bc17-4bb9-bb85-30c5cf1aaaa7" //@@ MS attribute
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export type AuthenticateEvent = (id_token: string) => void;
|
|
79
|
-
|
|
80
|
-
// ---------------
|
|
81
|
-
|
|
82
|
-
export enum IOauth2ListenerCommand {
|
|
83
|
-
RESTORE_SESSION = 'RestoreSession',
|
|
84
|
-
AUTHORIZE = 'Authorize',
|
|
85
|
-
HANDLE_REDIRECT = 'HandleRedirect',
|
|
86
|
-
LOGOUT = 'Logout',
|
|
87
|
-
AUTHENTICATE_EVENT = 'AuthenticateEvent',
|
|
88
|
-
ERROR = 'Error',
|
|
89
|
-
LOG = '__LOG',
|
|
90
|
-
UPDATE_INSTRUMENT = '__UPDATE_INSTRUMENT'
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export interface IOauth2ListenerMessage {
|
|
94
|
-
messageId?: number
|
|
95
|
-
command: IOauth2ListenerCommand
|
|
96
|
-
payload?: any
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export interface IOauth2ListenerMessageResponse {
|
|
100
|
-
messageId: number
|
|
101
|
-
command: IOauth2ListenerCommand
|
|
102
|
-
payload: any
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export type StsOauth2WorkerFactory = () => Worker
|
|
106
|
-
|
|
107
|
-
export interface ISTSOAuth2WorkerOptions {
|
|
108
|
-
client_id: string
|
|
109
|
-
scope: string
|
|
110
|
-
redirect_uri: string
|
|
111
|
-
audience: string
|
|
112
|
-
|
|
113
|
-
brokerendpoint: string
|
|
114
|
-
brokerport: string
|
|
115
|
-
brokerapiroot: string
|
|
116
|
-
|
|
117
|
-
authorizeendpoint: string
|
|
118
|
-
authorizeport: string
|
|
119
|
-
authorizeapiroot: string
|
|
120
|
-
|
|
121
|
-
timeout: number
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export interface ISTSOAuth2ManagerOptions {
|
|
125
|
-
authenticateEvent?: AuthenticateEvent
|
|
126
|
-
workerFactory?: StsOauth2WorkerFactory
|
|
127
|
-
workerOptions: ISTSOAuth2WorkerOptions
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export interface ISTSOAuth2WorkerMessage {
|
|
131
|
-
workerPort: MessagePort,
|
|
132
|
-
options: ISTSOAuth2WorkerOptions
|
|
133
|
-
}
|