@cloudbase/oauth 2.5.39-beta.0 → 2.5.41-beta.0
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/cjs/auth/apis.d.ts +3 -1
- package/dist/cjs/auth/apis.js +13 -1
- package/dist/cjs/auth/consts.d.ts +2 -1
- package/dist/cjs/auth/consts.js +2 -1
- package/dist/cjs/auth/models.d.ts +4 -0
- package/dist/cjs/auth/models.js +1 -1
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/utils/encrypt.d.ts +1 -1
- package/dist/cjs/utils/encrypt.js +2 -2
- package/dist/cjs/utils/encryptlong/index.d.ts +154 -0
- package/dist/cjs/utils/encryptlong/index.js +4029 -0
- package/dist/esm/auth/apis.d.ts +3 -1
- package/dist/esm/auth/apis.js +13 -1
- package/dist/esm/auth/consts.d.ts +2 -1
- package/dist/esm/auth/consts.js +2 -1
- package/dist/esm/auth/models.d.ts +4 -0
- package/dist/esm/auth/models.js +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/utils/encrypt.d.ts +1 -1
- package/dist/esm/utils/encrypt.js +2 -2
- package/dist/esm/utils/encryptlong/index.d.ts +154 -0
- package/dist/esm/utils/encryptlong/index.js +4027 -0
- package/package.json +2 -2
- package/src/auth/apis.ts +15 -0
- package/src/auth/consts.ts +2 -1
- package/src/auth/models.ts +5 -0
- package/src/index.ts +2 -2
- package/src/utils/encrypt.ts +1 -1
- package/src/utils/encryptlong/index.js +5444 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/oauth",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.41-beta.0",
|
|
4
4
|
"description": "cloudbase javascript sdk auth componets",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"encryptlong": "^3.1.4"
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "e8513caf4d4c69629977296f3a977e831bddd314"
|
|
25
25
|
}
|
package/src/auth/apis.ts
CHANGED
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
WithSudoRequest,
|
|
44
44
|
PublicKey,
|
|
45
45
|
EncryptParams,
|
|
46
|
+
ProviderSubType,
|
|
46
47
|
} from './models'
|
|
47
48
|
import { SimpleStorage, RequestFunction } from '../oauth2client/interface'
|
|
48
49
|
import { OAuth2Client, defaultStorage } from '../oauth2client/oauth2client'
|
|
@@ -56,6 +57,7 @@ export interface AuthOptions {
|
|
|
56
57
|
clientId: string;
|
|
57
58
|
credentialsClient?: OAuth2Client;
|
|
58
59
|
request?: RequestFunction;
|
|
60
|
+
baseRequest?: RequestFunction;
|
|
59
61
|
storage?: SimpleStorage;
|
|
60
62
|
anonymousSignInFunc?: (Credentials) => Promise<Credentials | void>;
|
|
61
63
|
}
|
|
@@ -758,4 +760,17 @@ export class Auth {
|
|
|
758
760
|
public_key_thumbprint,
|
|
759
761
|
}
|
|
760
762
|
}
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* get provider sub type
|
|
766
|
+
* @returns
|
|
767
|
+
*/
|
|
768
|
+
public async getProviderSubType(): Promise<ProviderSubType> {
|
|
769
|
+
return this.config.request<ProviderSubType>(ApiUrls.GET_PROVIDER_TYPE, {
|
|
770
|
+
method: 'POST',
|
|
771
|
+
body: {
|
|
772
|
+
provider_id: 'weda',
|
|
773
|
+
},
|
|
774
|
+
})
|
|
775
|
+
}
|
|
761
776
|
}
|
package/src/auth/consts.ts
CHANGED
|
@@ -24,7 +24,8 @@ export enum ApiUrls {
|
|
|
24
24
|
AUTH_RESET_PASSWORD = '/auth/v1/reset',
|
|
25
25
|
AUTH_GET_DEVICE_CODE = '/auth/v1/device/code',
|
|
26
26
|
CHECK_USERNAME = '/auth/v1/checkUsername',
|
|
27
|
-
CHECK_IF_USER_EXIST = '/auth/v1/checkIfUserExist'
|
|
27
|
+
CHECK_IF_USER_EXIST = '/auth/v1/checkIfUserExist',
|
|
28
|
+
GET_PROVIDER_TYPE = '/auth/v1/mgr/provider/providerSubType'
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
export enum ApiUrlsV2 {
|
package/src/auth/models.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -33,12 +33,12 @@ export class CloudbaseOAuth {
|
|
|
33
33
|
public authApi: Auth
|
|
34
34
|
|
|
35
35
|
constructor(authOptions: AuthOptions) {
|
|
36
|
-
const { apiOrigin, clientId, storage, request, anonymousSignInFunc } = authOptions
|
|
36
|
+
const { apiOrigin, clientId, storage, request, baseRequest, anonymousSignInFunc } = authOptions
|
|
37
37
|
this.oauth2client = new OAuth2Client({
|
|
38
38
|
apiOrigin,
|
|
39
39
|
clientId,
|
|
40
40
|
storage,
|
|
41
|
-
baseRequest: request,
|
|
41
|
+
baseRequest: baseRequest || request,
|
|
42
42
|
anonymousSignInFunc,
|
|
43
43
|
})
|
|
44
44
|
|
package/src/utils/encrypt.ts
CHANGED