@23blocks/block-authentication 6.1.0 → 6.3.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/index.esm.js +308 -2
- package/dist/src/lib/authentication.block.d.ts +20 -1
- package/dist/src/lib/authentication.block.d.ts.map +1 -1
- package/dist/src/lib/services/index.d.ts +3 -0
- package/dist/src/lib/services/index.d.ts.map +1 -1
- package/dist/src/lib/services/jwks.service.d.ts +58 -0
- package/dist/src/lib/services/jwks.service.d.ts.map +1 -0
- package/dist/src/lib/services/oidc.service.d.ts +58 -0
- package/dist/src/lib/services/oidc.service.d.ts.map +1 -0
- package/dist/src/lib/services/permissions.service.d.ts +56 -0
- package/dist/src/lib/services/permissions.service.d.ts.map +1 -0
- package/dist/src/lib/types/index.d.ts +2 -0
- package/dist/src/lib/types/index.d.ts.map +1 -1
- package/dist/src/lib/types/jwks.d.ts +46 -0
- package/dist/src/lib/types/jwks.d.ts.map +1 -0
- package/dist/src/lib/types/oidc.d.ts +94 -0
- package/dist/src/lib/types/oidc.d.ts.map +1 -0
- package/package.json +14 -4
package/dist/index.esm.js
CHANGED
|
@@ -1563,6 +1563,57 @@ const subscriptionMapper = {
|
|
|
1563
1563
|
};
|
|
1564
1564
|
}
|
|
1565
1565
|
|
|
1566
|
+
/**
|
|
1567
|
+
* Create the permissions service
|
|
1568
|
+
*/ function createPermissionsService(transport, _config) {
|
|
1569
|
+
return {
|
|
1570
|
+
async list (params) {
|
|
1571
|
+
const queryParams = {};
|
|
1572
|
+
if (params == null ? void 0 : params.page) queryParams['page[number]'] = params.page;
|
|
1573
|
+
if (params == null ? void 0 : params.perPage) queryParams['page[size]'] = params.perPage;
|
|
1574
|
+
if (params == null ? void 0 : params.include) queryParams['include'] = params.include.join(',');
|
|
1575
|
+
const response = await transport.get('/permissions', {
|
|
1576
|
+
params: queryParams
|
|
1577
|
+
});
|
|
1578
|
+
return decodePageResult(response, permissionMapper);
|
|
1579
|
+
},
|
|
1580
|
+
async get (id) {
|
|
1581
|
+
const response = await transport.get(`/permissions/${id}`);
|
|
1582
|
+
return decodeOne(response, permissionMapper);
|
|
1583
|
+
},
|
|
1584
|
+
async create (request) {
|
|
1585
|
+
const response = await transport.post('/permissions', {
|
|
1586
|
+
permission: {
|
|
1587
|
+
name: request.name,
|
|
1588
|
+
level: request.level,
|
|
1589
|
+
parent_id: request.parentId,
|
|
1590
|
+
description: request.description,
|
|
1591
|
+
category: request.category,
|
|
1592
|
+
risk_level: request.riskLevel
|
|
1593
|
+
}
|
|
1594
|
+
});
|
|
1595
|
+
return decodeOne(response, permissionMapper);
|
|
1596
|
+
},
|
|
1597
|
+
async update (id, request) {
|
|
1598
|
+
const response = await transport.put(`/permissions/${id}`, {
|
|
1599
|
+
permission: {
|
|
1600
|
+
name: request.name,
|
|
1601
|
+
level: request.level,
|
|
1602
|
+
parent_id: request.parentId,
|
|
1603
|
+
description: request.description,
|
|
1604
|
+
status: request.status,
|
|
1605
|
+
category: request.category,
|
|
1606
|
+
risk_level: request.riskLevel
|
|
1607
|
+
}
|
|
1608
|
+
});
|
|
1609
|
+
return decodeOne(response, permissionMapper);
|
|
1610
|
+
},
|
|
1611
|
+
async delete (id) {
|
|
1612
|
+
await transport.delete(`/permissions/${id}`);
|
|
1613
|
+
}
|
|
1614
|
+
};
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1566
1617
|
/**
|
|
1567
1618
|
* Create the API keys service
|
|
1568
1619
|
*/ function createApiKeysService(transport, _config) {
|
|
@@ -2762,6 +2813,255 @@ const tenantUserMapper = {
|
|
|
2762
2813
|
};
|
|
2763
2814
|
}
|
|
2764
2815
|
|
|
2816
|
+
/**
|
|
2817
|
+
* Create the JWKS service
|
|
2818
|
+
*/ function createJwksService(transport) {
|
|
2819
|
+
return {
|
|
2820
|
+
async getJwks () {
|
|
2821
|
+
const response = await transport.get('/.well-known/jwks.json');
|
|
2822
|
+
return {
|
|
2823
|
+
keys: response.keys.map((key)=>({
|
|
2824
|
+
kty: key.kty,
|
|
2825
|
+
use: key.use,
|
|
2826
|
+
key_ops: key.key_ops,
|
|
2827
|
+
alg: key.alg,
|
|
2828
|
+
kid: key.kid,
|
|
2829
|
+
x5u: key.x5u,
|
|
2830
|
+
x5c: key.x5c,
|
|
2831
|
+
x5t: key.x5t,
|
|
2832
|
+
'x5t#S256': key['x5t#S256'],
|
|
2833
|
+
n: key.n,
|
|
2834
|
+
e: key.e,
|
|
2835
|
+
crv: key.crv,
|
|
2836
|
+
x: key.x,
|
|
2837
|
+
y: key.y
|
|
2838
|
+
}))
|
|
2839
|
+
};
|
|
2840
|
+
},
|
|
2841
|
+
async getKey (kid) {
|
|
2842
|
+
const jwks = await this.getJwks();
|
|
2843
|
+
var _jwks_keys_find;
|
|
2844
|
+
return (_jwks_keys_find = jwks.keys.find((key)=>key.kid === kid)) != null ? _jwks_keys_find : null;
|
|
2845
|
+
}
|
|
2846
|
+
};
|
|
2847
|
+
}
|
|
2848
|
+
/**
|
|
2849
|
+
* Create the Admin RSA Keys service
|
|
2850
|
+
*/ function createAdminRsaKeysService(transport) {
|
|
2851
|
+
return {
|
|
2852
|
+
async list () {
|
|
2853
|
+
const response = await transport.get('/admin/rsa_keys');
|
|
2854
|
+
return response.data.map((item)=>({
|
|
2855
|
+
id: item.id,
|
|
2856
|
+
kid: item.attributes.kid,
|
|
2857
|
+
algorithm: item.attributes.algorithm,
|
|
2858
|
+
createdAt: new Date(item.attributes.created_at),
|
|
2859
|
+
expiresAt: item.attributes.expires_at ? new Date(item.attributes.expires_at) : undefined,
|
|
2860
|
+
isActive: item.attributes.is_active,
|
|
2861
|
+
publicKey: item.attributes.public_key
|
|
2862
|
+
}));
|
|
2863
|
+
},
|
|
2864
|
+
async get (keyId) {
|
|
2865
|
+
const response = await transport.get(`/admin/rsa_keys/${keyId}`);
|
|
2866
|
+
return {
|
|
2867
|
+
id: response.data.id,
|
|
2868
|
+
kid: response.data.attributes.kid,
|
|
2869
|
+
algorithm: response.data.attributes.algorithm,
|
|
2870
|
+
createdAt: new Date(response.data.attributes.created_at),
|
|
2871
|
+
expiresAt: response.data.attributes.expires_at ? new Date(response.data.attributes.expires_at) : undefined,
|
|
2872
|
+
isActive: response.data.attributes.is_active,
|
|
2873
|
+
publicKey: response.data.attributes.public_key
|
|
2874
|
+
};
|
|
2875
|
+
},
|
|
2876
|
+
async create (request) {
|
|
2877
|
+
const response = await transport.post('/admin/rsa_keys', {
|
|
2878
|
+
rsa_key: {
|
|
2879
|
+
algorithm: request.algorithm,
|
|
2880
|
+
expires_at: request.expiresAt
|
|
2881
|
+
}
|
|
2882
|
+
});
|
|
2883
|
+
return {
|
|
2884
|
+
id: response.data.id,
|
|
2885
|
+
kid: response.data.attributes.kid,
|
|
2886
|
+
algorithm: response.data.attributes.algorithm,
|
|
2887
|
+
createdAt: new Date(response.data.attributes.created_at),
|
|
2888
|
+
expiresAt: response.data.attributes.expires_at ? new Date(response.data.attributes.expires_at) : undefined,
|
|
2889
|
+
isActive: response.data.attributes.is_active,
|
|
2890
|
+
publicKey: response.data.attributes.public_key
|
|
2891
|
+
};
|
|
2892
|
+
},
|
|
2893
|
+
async rotate (request) {
|
|
2894
|
+
const response = await transport.post('/admin/rsa_keys/rotate', {
|
|
2895
|
+
rsa_key: {
|
|
2896
|
+
algorithm: request.algorithm,
|
|
2897
|
+
expires_at: request.expiresAt
|
|
2898
|
+
}
|
|
2899
|
+
});
|
|
2900
|
+
return {
|
|
2901
|
+
id: response.data.id,
|
|
2902
|
+
kid: response.data.attributes.kid,
|
|
2903
|
+
algorithm: response.data.attributes.algorithm,
|
|
2904
|
+
createdAt: new Date(response.data.attributes.created_at),
|
|
2905
|
+
expiresAt: response.data.attributes.expires_at ? new Date(response.data.attributes.expires_at) : undefined,
|
|
2906
|
+
isActive: response.data.attributes.is_active,
|
|
2907
|
+
publicKey: response.data.attributes.public_key
|
|
2908
|
+
};
|
|
2909
|
+
},
|
|
2910
|
+
async deactivate (keyId) {
|
|
2911
|
+
const response = await transport.put(`/admin/rsa_keys/${keyId}/deactivate`, {});
|
|
2912
|
+
return {
|
|
2913
|
+
id: response.data.id,
|
|
2914
|
+
kid: response.data.attributes.kid,
|
|
2915
|
+
algorithm: response.data.attributes.algorithm,
|
|
2916
|
+
createdAt: new Date(response.data.attributes.created_at),
|
|
2917
|
+
expiresAt: response.data.attributes.expires_at ? new Date(response.data.attributes.expires_at) : undefined,
|
|
2918
|
+
isActive: response.data.attributes.is_active,
|
|
2919
|
+
publicKey: response.data.attributes.public_key
|
|
2920
|
+
};
|
|
2921
|
+
},
|
|
2922
|
+
async delete (keyId) {
|
|
2923
|
+
await transport.delete(`/admin/rsa_keys/${keyId}`);
|
|
2924
|
+
},
|
|
2925
|
+
async getActive () {
|
|
2926
|
+
const keys = await this.list();
|
|
2927
|
+
var _keys_find;
|
|
2928
|
+
return (_keys_find = keys.find((key)=>key.isActive)) != null ? _keys_find : null;
|
|
2929
|
+
}
|
|
2930
|
+
};
|
|
2931
|
+
}
|
|
2932
|
+
|
|
2933
|
+
/**
|
|
2934
|
+
* Create the OIDC service
|
|
2935
|
+
*/ function createOidcService(transport, baseUrl) {
|
|
2936
|
+
return {
|
|
2937
|
+
async getDiscovery () {
|
|
2938
|
+
const response = await transport.get('/.well-known/openid-configuration');
|
|
2939
|
+
return {
|
|
2940
|
+
issuer: response.issuer,
|
|
2941
|
+
authorization_endpoint: response.authorization_endpoint,
|
|
2942
|
+
token_endpoint: response.token_endpoint,
|
|
2943
|
+
userinfo_endpoint: response.userinfo_endpoint,
|
|
2944
|
+
jwks_uri: response.jwks_uri,
|
|
2945
|
+
registration_endpoint: response.registration_endpoint,
|
|
2946
|
+
scopes_supported: response.scopes_supported,
|
|
2947
|
+
response_types_supported: response.response_types_supported,
|
|
2948
|
+
response_modes_supported: response.response_modes_supported,
|
|
2949
|
+
grant_types_supported: response.grant_types_supported,
|
|
2950
|
+
subject_types_supported: response.subject_types_supported,
|
|
2951
|
+
id_token_signing_alg_values_supported: response.id_token_signing_alg_values_supported,
|
|
2952
|
+
claims_supported: response.claims_supported,
|
|
2953
|
+
token_endpoint_auth_methods_supported: response.token_endpoint_auth_methods_supported
|
|
2954
|
+
};
|
|
2955
|
+
},
|
|
2956
|
+
buildAuthorizeUrl (request) {
|
|
2957
|
+
const params = new URLSearchParams();
|
|
2958
|
+
params.set('response_type', request.responseType);
|
|
2959
|
+
params.set('client_id', request.clientId);
|
|
2960
|
+
params.set('redirect_uri', request.redirectUri);
|
|
2961
|
+
params.set('scope', request.scope);
|
|
2962
|
+
if (request.state) params.set('state', request.state);
|
|
2963
|
+
if (request.nonce) params.set('nonce', request.nonce);
|
|
2964
|
+
if (request.codeChallenge) params.set('code_challenge', request.codeChallenge);
|
|
2965
|
+
if (request.codeChallengeMethod) params.set('code_challenge_method', request.codeChallengeMethod);
|
|
2966
|
+
if (request.prompt) params.set('prompt', request.prompt);
|
|
2967
|
+
if (request.maxAge !== undefined) params.set('max_age', String(request.maxAge));
|
|
2968
|
+
if (request.uiLocales) params.set('ui_locales', request.uiLocales);
|
|
2969
|
+
if (request.loginHint) params.set('login_hint', request.loginHint);
|
|
2970
|
+
if (request.acrValues) params.set('acr_values', request.acrValues);
|
|
2971
|
+
const base = '';
|
|
2972
|
+
return `${base}/oauth/authorize?${params.toString()}`;
|
|
2973
|
+
},
|
|
2974
|
+
async exchangeCode (request) {
|
|
2975
|
+
const body = {
|
|
2976
|
+
grant_type: request.grantType,
|
|
2977
|
+
client_id: request.clientId
|
|
2978
|
+
};
|
|
2979
|
+
if (request.code) body.code = request.code;
|
|
2980
|
+
if (request.redirectUri) body.redirect_uri = request.redirectUri;
|
|
2981
|
+
if (request.clientSecret) body.client_secret = request.clientSecret;
|
|
2982
|
+
if (request.refreshToken) body.refresh_token = request.refreshToken;
|
|
2983
|
+
if (request.codeVerifier) body.code_verifier = request.codeVerifier;
|
|
2984
|
+
if (request.scope) body.scope = request.scope;
|
|
2985
|
+
const response = await transport.post('/oauth/token', body);
|
|
2986
|
+
return {
|
|
2987
|
+
access_token: response.access_token,
|
|
2988
|
+
token_type: response.token_type,
|
|
2989
|
+
expires_in: response.expires_in,
|
|
2990
|
+
refresh_token: response.refresh_token,
|
|
2991
|
+
id_token: response.id_token,
|
|
2992
|
+
scope: response.scope
|
|
2993
|
+
};
|
|
2994
|
+
},
|
|
2995
|
+
async refreshToken (refreshToken, clientId) {
|
|
2996
|
+
return this.exchangeCode({
|
|
2997
|
+
grantType: 'refresh_token',
|
|
2998
|
+
refreshToken,
|
|
2999
|
+
clientId
|
|
3000
|
+
});
|
|
3001
|
+
},
|
|
3002
|
+
async getUserInfo (accessToken) {
|
|
3003
|
+
const response = await transport.get('/oauth/userinfo');
|
|
3004
|
+
return {
|
|
3005
|
+
sub: response.sub,
|
|
3006
|
+
name: response.name,
|
|
3007
|
+
given_name: response.given_name,
|
|
3008
|
+
family_name: response.family_name,
|
|
3009
|
+
middle_name: response.middle_name,
|
|
3010
|
+
nickname: response.nickname,
|
|
3011
|
+
preferred_username: response.preferred_username,
|
|
3012
|
+
profile: response.profile,
|
|
3013
|
+
picture: response.picture,
|
|
3014
|
+
website: response.website,
|
|
3015
|
+
email: response.email,
|
|
3016
|
+
email_verified: response.email_verified,
|
|
3017
|
+
gender: response.gender,
|
|
3018
|
+
birthdate: response.birthdate,
|
|
3019
|
+
zoneinfo: response.zoneinfo,
|
|
3020
|
+
locale: response.locale,
|
|
3021
|
+
phone_number: response.phone_number,
|
|
3022
|
+
phone_number_verified: response.phone_number_verified,
|
|
3023
|
+
address: response.address,
|
|
3024
|
+
updated_at: response.updated_at
|
|
3025
|
+
};
|
|
3026
|
+
},
|
|
3027
|
+
async introspect (token) {
|
|
3028
|
+
const response = await transport.post('/oauth/introspect', {
|
|
3029
|
+
token
|
|
3030
|
+
});
|
|
3031
|
+
return {
|
|
3032
|
+
active: response.active,
|
|
3033
|
+
scope: response.scope,
|
|
3034
|
+
clientId: response.client_id,
|
|
3035
|
+
username: response.username,
|
|
3036
|
+
tokenType: response.token_type,
|
|
3037
|
+
exp: response.exp,
|
|
3038
|
+
iat: response.iat,
|
|
3039
|
+
nbf: response.nbf,
|
|
3040
|
+
sub: response.sub,
|
|
3041
|
+
aud: response.aud,
|
|
3042
|
+
iss: response.iss,
|
|
3043
|
+
jti: response.jti
|
|
3044
|
+
};
|
|
3045
|
+
},
|
|
3046
|
+
async revoke (token, tokenTypeHint) {
|
|
3047
|
+
const body = {
|
|
3048
|
+
token
|
|
3049
|
+
};
|
|
3050
|
+
if (tokenTypeHint) body.token_type_hint = tokenTypeHint;
|
|
3051
|
+
await transport.post('/oauth/revoke', body);
|
|
3052
|
+
},
|
|
3053
|
+
endSession (idToken, postLogoutRedirectUri, state) {
|
|
3054
|
+
const params = new URLSearchParams();
|
|
3055
|
+
if (idToken) params.set('id_token_hint', idToken);
|
|
3056
|
+
if (postLogoutRedirectUri) params.set('post_logout_redirect_uri', postLogoutRedirectUri);
|
|
3057
|
+
if (state) params.set('state', state);
|
|
3058
|
+
const base = '';
|
|
3059
|
+
const query = params.toString();
|
|
3060
|
+
return query ? `${base}/oauth/logout?${query}` : `${base}/oauth/logout`;
|
|
3061
|
+
}
|
|
3062
|
+
};
|
|
3063
|
+
}
|
|
3064
|
+
|
|
2765
3065
|
/**
|
|
2766
3066
|
* Create the Authentication block
|
|
2767
3067
|
*
|
|
@@ -2797,6 +3097,7 @@ const tenantUserMapper = {
|
|
|
2797
3097
|
auth: createAuthService(transport),
|
|
2798
3098
|
users: createUsersService(transport),
|
|
2799
3099
|
roles: createRolesService(transport),
|
|
3100
|
+
permissions: createPermissionsService(transport),
|
|
2800
3101
|
apiKeys: createApiKeysService(transport),
|
|
2801
3102
|
mfa: createMfaService(transport),
|
|
2802
3103
|
oauth: createOAuthService(transport),
|
|
@@ -2818,7 +3119,10 @@ const tenantUserMapper = {
|
|
|
2818
3119
|
refreshTokens: createRefreshTokensService(transport),
|
|
2819
3120
|
userDevices: createUserDevicesService(transport),
|
|
2820
3121
|
tenantUsers: createTenantUsersService(transport),
|
|
2821
|
-
mailTemplates: createMailTemplatesService(transport)
|
|
3122
|
+
mailTemplates: createMailTemplatesService(transport),
|
|
3123
|
+
jwks: createJwksService(transport),
|
|
3124
|
+
adminRsaKeys: createAdminRsaKeysService(transport),
|
|
3125
|
+
oidc: createOidcService(transport)
|
|
2822
3126
|
};
|
|
2823
3127
|
}
|
|
2824
3128
|
/**
|
|
@@ -2855,7 +3159,9 @@ const tenantUserMapper = {
|
|
|
2855
3159
|
'RefreshToken',
|
|
2856
3160
|
'UserDevice',
|
|
2857
3161
|
'TenantUser',
|
|
2858
|
-
'MailTemplate'
|
|
3162
|
+
'MailTemplate',
|
|
3163
|
+
'RsaKey',
|
|
3164
|
+
'JsonWebKey'
|
|
2859
3165
|
]
|
|
2860
3166
|
};
|
|
2861
3167
|
|
|
@@ -2,6 +2,7 @@ import type { Transport, BlockConfig } from '@23blocks/contracts';
|
|
|
2
2
|
import { type AuthService } from './services/auth.service.js';
|
|
3
3
|
import { type UsersService } from './services/users.service.js';
|
|
4
4
|
import { type RolesService } from './services/roles.service.js';
|
|
5
|
+
import { type PermissionsService } from './services/permissions.service.js';
|
|
5
6
|
import { type ApiKeysService } from './services/api-keys.service.js';
|
|
6
7
|
import { type AppsService, type BlocksService, type ServicesRegistryService } from './services/apps.service.js';
|
|
7
8
|
import { type SubscriptionModelsService, type UserSubscriptionsService, type CompanySubscriptionsService } from './services/subscriptions.service.js';
|
|
@@ -11,6 +12,8 @@ import { type MfaService } from './services/mfa.service.js';
|
|
|
11
12
|
import { type OAuthService } from './services/oauth.service.js';
|
|
12
13
|
import { type AvatarsService } from './services/avatars.service.js';
|
|
13
14
|
import { type TenantsService } from './services/tenants.service.js';
|
|
15
|
+
import { type JwksService, type AdminRsaKeysService } from './services/jwks.service.js';
|
|
16
|
+
import { type OidcService } from './services/oidc.service.js';
|
|
14
17
|
/**
|
|
15
18
|
* Configuration for the Authentication block
|
|
16
19
|
*/
|
|
@@ -33,9 +36,13 @@ export interface AuthenticationBlock {
|
|
|
33
36
|
*/
|
|
34
37
|
users: UsersService;
|
|
35
38
|
/**
|
|
36
|
-
* Role
|
|
39
|
+
* Role management
|
|
37
40
|
*/
|
|
38
41
|
roles: RolesService;
|
|
42
|
+
/**
|
|
43
|
+
* Permission management
|
|
44
|
+
*/
|
|
45
|
+
permissions: PermissionsService;
|
|
39
46
|
/**
|
|
40
47
|
* API key management
|
|
41
48
|
*/
|
|
@@ -124,6 +131,18 @@ export interface AuthenticationBlock {
|
|
|
124
131
|
* Mail template management
|
|
125
132
|
*/
|
|
126
133
|
mailTemplates: MailTemplatesService;
|
|
134
|
+
/**
|
|
135
|
+
* JWKS (JSON Web Key Set) operations
|
|
136
|
+
*/
|
|
137
|
+
jwks: JwksService;
|
|
138
|
+
/**
|
|
139
|
+
* Admin RSA key management
|
|
140
|
+
*/
|
|
141
|
+
adminRsaKeys: AdminRsaKeysService;
|
|
142
|
+
/**
|
|
143
|
+
* OpenID Connect operations
|
|
144
|
+
*/
|
|
145
|
+
oidc: OidcService;
|
|
127
146
|
}
|
|
128
147
|
/**
|
|
129
148
|
* Create the Authentication block
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authentication.block.d.ts","sourceRoot":"","sources":["../../../src/lib/authentication.block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAC3F,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EACjC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAML,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"authentication.block.d.ts","sourceRoot":"","sources":["../../../src/lib/authentication.block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAA4B,KAAK,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACtG,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAC3F,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC7B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EACjC,MAAM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H,OAAO,EAAE,cAAc,CAAC;IAExB;;OAEG;IACH,IAAI,EAAE,WAAW,CAAC;IAElB;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC;IAEtB;;OAEG;IACH,QAAQ,EAAE,uBAAuB,CAAC;IAElC;;OAEG;IACH,kBAAkB,EAAE,yBAAyB,CAAC;IAE9C;;OAEG;IACH,iBAAiB,EAAE,wBAAwB,CAAC;IAE5C;;OAEG;IACH,oBAAoB,EAAE,2BAA2B,CAAC;IAElD;;OAEG;IACH,SAAS,EAAE,gBAAgB,CAAC;IAE5B;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC;IAEtB;;OAEG;IACH,QAAQ,EAAE,eAAe,CAAC;IAE1B;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC;IAEtB;;OAEG;IACH,UAAU,EAAE,iBAAiB,CAAC;IAE9B;;OAEG;IACH,MAAM,EAAE,aAAa,CAAC;IAEtB;;OAEG;IACH,UAAU,EAAE,iBAAiB,CAAC;IAE9B;;OAEG;IACH,aAAa,EAAE,oBAAoB,CAAC;IAEpC;;OAEG;IACH,WAAW,EAAE,kBAAkB,CAAC;IAEhC;;OAEG;IACH,WAAW,EAAE,kBAAkB,CAAC;IAEhC;;OAEG;IACH,aAAa,EAAE,oBAAoB,CAAC;IAEpC;;OAEG;IACH,IAAI,EAAE,WAAW,CAAC;IAElB;;OAEG;IACH,YAAY,EAAE,mBAAmB,CAAC;IAElC;;OAEG;IACH,IAAI,EAAE,WAAW,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,yBAAyB,GAChC,mBAAmB,CAgCrB;AAED;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;CAavC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { createAuthService, type AuthService } from './auth.service.js';
|
|
2
2
|
export { createUsersService, type UsersService, type UpdateUserRequest, type UpdateProfileRequest } from './users.service.js';
|
|
3
3
|
export { createRolesService, type RolesService, type CreateRoleRequest, type UpdateRoleRequest } from './roles.service.js';
|
|
4
|
+
export { createPermissionsService, type PermissionsService, type CreatePermissionRequest, type UpdatePermissionRequest } from './permissions.service.js';
|
|
4
5
|
export { createApiKeysService, type ApiKeysService, type ApiKeyUsageStats } from './api-keys.service.js';
|
|
5
6
|
export { createAppsService, createBlocksService, createServicesRegistryService, type AppsService, type BlocksService, type ServicesRegistryService, } from './apps.service.js';
|
|
6
7
|
export { createSubscriptionModelsService, createUserSubscriptionsService, createCompanySubscriptionsService, type SubscriptionModelsService, type UserSubscriptionsService, type CompanySubscriptionsService, type SubscribeRequest, } from './subscriptions.service.js';
|
|
@@ -10,4 +11,6 @@ export { createMfaService, type MfaService } from './mfa.service.js';
|
|
|
10
11
|
export { createOAuthService, type OAuthService } from './oauth.service.js';
|
|
11
12
|
export { createAvatarsService, type AvatarsService } from './avatars.service.js';
|
|
12
13
|
export { createTenantsService, type TenantsService } from './tenants.service.js';
|
|
14
|
+
export { createJwksService, createAdminRsaKeysService, type JwksService, type AdminRsaKeysService, } from './jwks.service.js';
|
|
15
|
+
export { createOidcService, type OidcService } from './oidc.service.js';
|
|
13
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9H,OAAO,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC3H,OAAO,EAAE,oBAAoB,EAA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C;AAG7B,OAAO,EAAE,gBAAgB,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGrE,OAAO,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG3E,OAAO,EAAE,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGjF,OAAO,EAAE,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGjF,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,KAAK,WAAW,EAChB,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Transport } from '@23blocks/contracts';
|
|
2
|
+
import type { JsonWebKey, JwksResponse, RsaKey, CreateRsaKeyRequest, RotateRsaKeyRequest } from '../types/jwks.js';
|
|
3
|
+
/**
|
|
4
|
+
* JWKS Service Interface - JSON Web Key Set operations
|
|
5
|
+
*/
|
|
6
|
+
export interface JwksService {
|
|
7
|
+
/**
|
|
8
|
+
* Get the public JWKS (JSON Web Key Set)
|
|
9
|
+
* Typically accessed at /.well-known/jwks.json
|
|
10
|
+
*/
|
|
11
|
+
getJwks(): Promise<JwksResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Get a specific JSON Web Key by key ID
|
|
14
|
+
*/
|
|
15
|
+
getKey(kid: string): Promise<JsonWebKey | null>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Admin RSA Keys Service Interface - Key management for administrators
|
|
19
|
+
*/
|
|
20
|
+
export interface AdminRsaKeysService {
|
|
21
|
+
/**
|
|
22
|
+
* List all RSA keys
|
|
23
|
+
*/
|
|
24
|
+
list(): Promise<RsaKey[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Get a specific RSA key by ID
|
|
27
|
+
*/
|
|
28
|
+
get(keyId: string): Promise<RsaKey>;
|
|
29
|
+
/**
|
|
30
|
+
* Create a new RSA key
|
|
31
|
+
*/
|
|
32
|
+
create(request: CreateRsaKeyRequest): Promise<RsaKey>;
|
|
33
|
+
/**
|
|
34
|
+
* Rotate RSA keys (create new key and deactivate old ones)
|
|
35
|
+
*/
|
|
36
|
+
rotate(request: RotateRsaKeyRequest): Promise<RsaKey>;
|
|
37
|
+
/**
|
|
38
|
+
* Deactivate an RSA key
|
|
39
|
+
*/
|
|
40
|
+
deactivate(keyId: string): Promise<RsaKey>;
|
|
41
|
+
/**
|
|
42
|
+
* Delete an RSA key
|
|
43
|
+
*/
|
|
44
|
+
delete(keyId: string): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Get the currently active RSA key
|
|
47
|
+
*/
|
|
48
|
+
getActive(): Promise<RsaKey | null>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Create the JWKS service
|
|
52
|
+
*/
|
|
53
|
+
export declare function createJwksService(transport: Transport): JwksService;
|
|
54
|
+
/**
|
|
55
|
+
* Create the Admin RSA Keys service
|
|
56
|
+
*/
|
|
57
|
+
export declare function createAdminRsaKeysService(transport: Transport): AdminRsaKeysService;
|
|
58
|
+
//# sourceMappingURL=jwks.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwks.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/jwks.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,MAAM,EACN,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;IAEjC;;OAEG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;CACjD;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAE1B;;OAEG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEpC;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEtD;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEtD;;OAEG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3C;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErC;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACrC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,WAAW,CA+CnE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,SAAS,GAAG,mBAAmB,CAoKnF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Transport } from '@23blocks/contracts';
|
|
2
|
+
import type { OidcDiscovery, OidcAuthorizeRequest, OidcTokenRequest, OidcTokenResponse, OidcUserInfo } from '../types/oidc.js';
|
|
3
|
+
/**
|
|
4
|
+
* OIDC Service Interface - OpenID Connect operations
|
|
5
|
+
*/
|
|
6
|
+
export interface OidcService {
|
|
7
|
+
/**
|
|
8
|
+
* Get the OpenID Connect discovery document
|
|
9
|
+
* Typically accessed at /.well-known/openid-configuration
|
|
10
|
+
*/
|
|
11
|
+
getDiscovery(): Promise<OidcDiscovery>;
|
|
12
|
+
/**
|
|
13
|
+
* Build the authorization URL for redirect-based authentication
|
|
14
|
+
*/
|
|
15
|
+
buildAuthorizeUrl(request: OidcAuthorizeRequest): string;
|
|
16
|
+
/**
|
|
17
|
+
* Exchange authorization code for tokens
|
|
18
|
+
*/
|
|
19
|
+
exchangeCode(request: OidcTokenRequest): Promise<OidcTokenResponse>;
|
|
20
|
+
/**
|
|
21
|
+
* Refresh an access token using a refresh token
|
|
22
|
+
*/
|
|
23
|
+
refreshToken(refreshToken: string, clientId: string): Promise<OidcTokenResponse>;
|
|
24
|
+
/**
|
|
25
|
+
* Get user info from the userinfo endpoint
|
|
26
|
+
*/
|
|
27
|
+
getUserInfo(accessToken?: string): Promise<OidcUserInfo>;
|
|
28
|
+
/**
|
|
29
|
+
* Introspect a token (check if valid and get claims)
|
|
30
|
+
*/
|
|
31
|
+
introspect(token: string): Promise<{
|
|
32
|
+
active: boolean;
|
|
33
|
+
scope?: string;
|
|
34
|
+
clientId?: string;
|
|
35
|
+
username?: string;
|
|
36
|
+
tokenType?: string;
|
|
37
|
+
exp?: number;
|
|
38
|
+
iat?: number;
|
|
39
|
+
nbf?: number;
|
|
40
|
+
sub?: string;
|
|
41
|
+
aud?: string | string[];
|
|
42
|
+
iss?: string;
|
|
43
|
+
jti?: string;
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Revoke a token
|
|
47
|
+
*/
|
|
48
|
+
revoke(token: string, tokenTypeHint?: 'access_token' | 'refresh_token'): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* End the session (logout)
|
|
51
|
+
*/
|
|
52
|
+
endSession(idToken?: string, postLogoutRedirectUri?: string, state?: string): string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Create the OIDC service
|
|
56
|
+
*/
|
|
57
|
+
export declare function createOidcService(transport: Transport, baseUrl?: string): OidcService;
|
|
58
|
+
//# sourceMappingURL=oidc.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oidc.service.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H,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,cAAc,GAAG,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvF;;OAEG;IACH,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,qBAAqB,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACtF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CA6NrF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Transport, PageResult, ListParams } from '@23blocks/contracts';
|
|
2
|
+
import type { Permission } from '../types/index.js';
|
|
3
|
+
import type { AuthenticationBlockConfig } from '../authentication.block.js';
|
|
4
|
+
/**
|
|
5
|
+
* Create permission request
|
|
6
|
+
*/
|
|
7
|
+
export interface CreatePermissionRequest {
|
|
8
|
+
name: string;
|
|
9
|
+
level?: number;
|
|
10
|
+
parentId?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
category?: string;
|
|
13
|
+
riskLevel?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Update permission request
|
|
17
|
+
*/
|
|
18
|
+
export interface UpdatePermissionRequest {
|
|
19
|
+
name?: string;
|
|
20
|
+
level?: number;
|
|
21
|
+
parentId?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
status?: string;
|
|
24
|
+
category?: string;
|
|
25
|
+
riskLevel?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Permissions service for managing standalone permissions
|
|
29
|
+
*/
|
|
30
|
+
export interface PermissionsService {
|
|
31
|
+
/**
|
|
32
|
+
* List all permissions
|
|
33
|
+
*/
|
|
34
|
+
list(params?: ListParams): Promise<PageResult<Permission>>;
|
|
35
|
+
/**
|
|
36
|
+
* Get a permission by ID
|
|
37
|
+
*/
|
|
38
|
+
get(id: string): Promise<Permission>;
|
|
39
|
+
/**
|
|
40
|
+
* Create a new permission
|
|
41
|
+
*/
|
|
42
|
+
create(request: CreatePermissionRequest): Promise<Permission>;
|
|
43
|
+
/**
|
|
44
|
+
* Update a permission
|
|
45
|
+
*/
|
|
46
|
+
update(id: string, request: UpdatePermissionRequest): Promise<Permission>;
|
|
47
|
+
/**
|
|
48
|
+
* Delete a permission
|
|
49
|
+
*/
|
|
50
|
+
delete(id: string): Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Create the permissions service
|
|
54
|
+
*/
|
|
55
|
+
export declare function createPermissionsService(transport: Transport, _config: AuthenticationBlockConfig): PermissionsService;
|
|
56
|
+
//# sourceMappingURL=permissions.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/permissions.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IAE3D;;OAEG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAErC;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAE9D;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAE1E;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,yBAAyB,GACjC,kBAAkB,CA8DpB"}
|
|
@@ -10,4 +10,6 @@ export { type MfaSetupResponse as MfaSetupResponseFull, type MfaEnableRequest, t
|
|
|
10
10
|
export { type OAuthSocialLoginRequest, type TenantLoginRequest, type TokenIntrospectionResponse, type TokenRevokeRequest, type TokenRevokeAllRequest, type TokenRevokeResponse, type TenantContextCreateRequest, type TenantInfo, type TenantContextResponse, type TenantContextRevokeRequest, type TenantContextAuditEntry, } from './oauth.js';
|
|
11
11
|
export { type UserProfile as UserProfileFull, type ProfileRequest, type UpdateEmailRequest, type UserDevice as UserDeviceFull, type AddDeviceRequest, type UserSearchRequest, type AddUserSubscriptionRequest, type AccountRecoveryRequest, type AccountRecoveryResponse, type CompleteRecoveryRequest, type UserAvatar as UserAvatarFull, type CreateAvatarRequest, type AvatarPresignResponse, type MultipartPresignRequest, type MultipartPresignResponse, type MultipartCompleteRequest, type MultipartCompleteResponse, } from './user-extended.js';
|
|
12
12
|
export { type TenantUser as TenantUserFull, type CreateTenantUserRequest, type ValidateTenantCodeRequest, type ValidateTenantCodeResponse, type SearchTenantRequest, type UpdateTenantUserOnboardingRequest, type UpdateTenantUserSalesRequest, type ResendInvitationRequest, } from './tenant.js';
|
|
13
|
+
export { type JsonWebKey, type JwksResponse, type RsaKey, type CreateRsaKeyRequest, type RotateRsaKeyRequest, } from './jwks.js';
|
|
14
|
+
export { type OidcDiscovery, type OidcAuthorizeRequest, type OidcTokenRequest, type OidcTokenResponse, type OidcUserInfo, } from './oidc.js';
|
|
13
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,WAAW,GACZ,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,MAAM,GACZ,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,wBAAw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A0B,EAC/B,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,GAC7B,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,KAAK,WAAW,IAAI,eAAe,EACnC,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,UAAU,IAAI,cAAc,EACjC,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,UAAU,IAAI,cAAc,EACjC,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,GAC/B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,KAAK,UAAU,IAAI,cAAc,EACjC,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,iCAAiC,EACtC,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,GAC7B,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,YAAY,GAClB,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON Web Key (JWK) representation
|
|
3
|
+
*/
|
|
4
|
+
export interface JsonWebKey {
|
|
5
|
+
kty: string;
|
|
6
|
+
use?: string;
|
|
7
|
+
key_ops?: string[];
|
|
8
|
+
alg?: string;
|
|
9
|
+
kid?: string;
|
|
10
|
+
x5u?: string;
|
|
11
|
+
x5c?: string[];
|
|
12
|
+
x5t?: string;
|
|
13
|
+
'x5t#S256'?: string;
|
|
14
|
+
n?: string;
|
|
15
|
+
e?: string;
|
|
16
|
+
crv?: string;
|
|
17
|
+
x?: string;
|
|
18
|
+
y?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* JSON Web Key Set (JWKS) response
|
|
22
|
+
*/
|
|
23
|
+
export interface JwksResponse {
|
|
24
|
+
keys: JsonWebKey[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* RSA Key for admin management
|
|
28
|
+
*/
|
|
29
|
+
export interface RsaKey {
|
|
30
|
+
id: string;
|
|
31
|
+
kid: string;
|
|
32
|
+
algorithm: string;
|
|
33
|
+
createdAt: Date;
|
|
34
|
+
expiresAt?: Date;
|
|
35
|
+
isActive: boolean;
|
|
36
|
+
publicKey: string;
|
|
37
|
+
}
|
|
38
|
+
export interface CreateRsaKeyRequest {
|
|
39
|
+
algorithm?: string;
|
|
40
|
+
expiresAt?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface RotateRsaKeyRequest {
|
|
43
|
+
algorithm?: string;
|
|
44
|
+
expiresAt?: string;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=jwks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwks.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/jwks.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IAEX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,UAAU,EAAE,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenID Connect Discovery document
|
|
3
|
+
*/
|
|
4
|
+
export interface OidcDiscovery {
|
|
5
|
+
issuer: string;
|
|
6
|
+
authorization_endpoint: string;
|
|
7
|
+
token_endpoint: string;
|
|
8
|
+
userinfo_endpoint: string;
|
|
9
|
+
jwks_uri: string;
|
|
10
|
+
registration_endpoint?: string;
|
|
11
|
+
scopes_supported: string[];
|
|
12
|
+
response_types_supported: string[];
|
|
13
|
+
response_modes_supported?: string[];
|
|
14
|
+
grant_types_supported?: string[];
|
|
15
|
+
subject_types_supported: string[];
|
|
16
|
+
id_token_signing_alg_values_supported: string[];
|
|
17
|
+
claims_supported?: string[];
|
|
18
|
+
token_endpoint_auth_methods_supported?: string[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* OIDC Authorization request parameters
|
|
22
|
+
*/
|
|
23
|
+
export interface OidcAuthorizeRequest {
|
|
24
|
+
responseType: string;
|
|
25
|
+
clientId: string;
|
|
26
|
+
redirectUri: string;
|
|
27
|
+
scope: string;
|
|
28
|
+
state?: string;
|
|
29
|
+
nonce?: string;
|
|
30
|
+
codeChallenge?: string;
|
|
31
|
+
codeChallengeMethod?: string;
|
|
32
|
+
prompt?: 'none' | 'login' | 'consent' | 'select_account';
|
|
33
|
+
maxAge?: number;
|
|
34
|
+
uiLocales?: string;
|
|
35
|
+
loginHint?: string;
|
|
36
|
+
acrValues?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* OIDC Token request
|
|
40
|
+
*/
|
|
41
|
+
export interface OidcTokenRequest {
|
|
42
|
+
grantType: 'authorization_code' | 'refresh_token' | 'client_credentials';
|
|
43
|
+
code?: string;
|
|
44
|
+
redirectUri?: string;
|
|
45
|
+
clientId: string;
|
|
46
|
+
clientSecret?: string;
|
|
47
|
+
refreshToken?: string;
|
|
48
|
+
codeVerifier?: string;
|
|
49
|
+
scope?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* OIDC Token response
|
|
53
|
+
*/
|
|
54
|
+
export interface OidcTokenResponse {
|
|
55
|
+
access_token: string;
|
|
56
|
+
token_type: string;
|
|
57
|
+
expires_in: number;
|
|
58
|
+
refresh_token?: string;
|
|
59
|
+
id_token?: string;
|
|
60
|
+
scope?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* OIDC UserInfo response
|
|
64
|
+
*/
|
|
65
|
+
export interface OidcUserInfo {
|
|
66
|
+
sub: string;
|
|
67
|
+
name?: string;
|
|
68
|
+
given_name?: string;
|
|
69
|
+
family_name?: string;
|
|
70
|
+
middle_name?: string;
|
|
71
|
+
nickname?: string;
|
|
72
|
+
preferred_username?: string;
|
|
73
|
+
profile?: string;
|
|
74
|
+
picture?: string;
|
|
75
|
+
website?: string;
|
|
76
|
+
email?: string;
|
|
77
|
+
email_verified?: boolean;
|
|
78
|
+
gender?: string;
|
|
79
|
+
birthdate?: string;
|
|
80
|
+
zoneinfo?: string;
|
|
81
|
+
locale?: string;
|
|
82
|
+
phone_number?: string;
|
|
83
|
+
phone_number_verified?: boolean;
|
|
84
|
+
address?: {
|
|
85
|
+
formatted?: string;
|
|
86
|
+
street_address?: string;
|
|
87
|
+
locality?: string;
|
|
88
|
+
region?: string;
|
|
89
|
+
postal_code?: string;
|
|
90
|
+
country?: string;
|
|
91
|
+
};
|
|
92
|
+
updated_at?: number;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=oidc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oidc.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/oidc.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IACpC,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAClC,qCAAqC,EAAE,MAAM,EAAE,CAAC;IAChD,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,qCAAqC,CAAC,EAAE,MAAM,EAAE,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE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M,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@23blocks/block-authentication",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"description": "Authentication block for 23blocks SDK - users, roles, API keys, subscriptions",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "23blocks <hello@23blocks.com>",
|
|
@@ -15,12 +15,22 @@
|
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"23blocks",
|
|
18
|
-
"sdk",
|
|
19
18
|
"authentication",
|
|
20
19
|
"auth",
|
|
21
|
-
"
|
|
20
|
+
"authentication-sdk",
|
|
21
|
+
"user-management",
|
|
22
22
|
"roles",
|
|
23
|
-
"api-keys"
|
|
23
|
+
"api-keys",
|
|
24
|
+
"oauth",
|
|
25
|
+
"mfa",
|
|
26
|
+
"multi-factor-auth",
|
|
27
|
+
"jwt",
|
|
28
|
+
"token-auth",
|
|
29
|
+
"login",
|
|
30
|
+
"signup",
|
|
31
|
+
"password-reset",
|
|
32
|
+
"session-management",
|
|
33
|
+
"typescript"
|
|
24
34
|
],
|
|
25
35
|
"type": "module",
|
|
26
36
|
"main": "./dist/index.esm.js",
|