@tsg-dsp/tsg-sdk 0.20.1 → 0.21.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/README.md +116 -27
- package/dist/.generated/control-plane.d.ts +287 -344
- package/dist/.generated/sso-bridge.d.ts +979 -42
- package/dist/.generated/wallet.d.ts +104 -206
- package/dist/auth/auth.provider.d.ts +5 -1
- package/dist/auth/auth.provider.d.ts.map +1 -1
- package/dist/auth/auth.provider.js +9 -1
- package/dist/auth/auth.provider.js.map +1 -1
- package/dist/browser.d.ts +525 -523
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +17 -4
- package/dist/browser.js.map +1 -1
- package/dist/catalog/catalog.sdk.d.ts.map +1 -1
- package/dist/catalog/catalog.sdk.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -1
- package/dist/config/sdk.config.d.ts +20 -4
- package/dist/config/sdk.config.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/metadata/metadata.sdk.d.ts +10 -7
- package/dist/metadata/metadata.sdk.d.ts.map +1 -1
- package/dist/metadata/metadata.sdk.js +7 -4
- package/dist/metadata/metadata.sdk.js.map +1 -1
- package/dist/negotiations/negotiations.sdk.d.ts +1 -1
- package/dist/negotiations/negotiations.sdk.d.ts.map +1 -1
- package/dist/negotiations/negotiations.sdk.js.map +1 -1
- package/dist/requirements/requirements.sdk.d.ts.map +1 -1
- package/dist/requirements/requirements.sdk.js.map +1 -1
- package/dist/sso/sso-management.sdk.d.ts.map +1 -1
- package/dist/sso/sso-management.sdk.js.map +1 -1
- package/dist/sso/sso.sdk.d.ts +1 -1
- package/dist/sso/sso.sdk.d.ts.map +1 -1
- package/dist/sso/sso.sdk.js +4 -2
- package/dist/sso/sso.sdk.js.map +1 -1
- package/dist/tenants/tenant-management.sdk.d.ts +48 -0
- package/dist/tenants/tenant-management.sdk.d.ts.map +1 -0
- package/dist/tenants/tenant-management.sdk.js +107 -0
- package/dist/tenants/tenant-management.sdk.js.map +1 -0
- package/dist/transfers/transfers.sdk.d.ts +27 -8
- package/dist/transfers/transfers.sdk.d.ts.map +1 -1
- package/dist/transfers/transfers.sdk.js +15 -1
- package/dist/transfers/transfers.sdk.js.map +1 -1
- package/dist/tsg-sdk.d.ts +4 -1
- package/dist/tsg-sdk.d.ts.map +1 -1
- package/dist/tsg-sdk.js +23 -6
- package/dist/tsg-sdk.js.map +1 -1
- package/dist/utils/errors.d.ts +2 -2
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/reason.d.ts +16 -0
- package/dist/utils/reason.d.ts.map +1 -0
- package/dist/utils/reason.js +34 -0
- package/dist/utils/reason.js.map +1 -0
- package/dist/utils/validate.js.map +1 -1
- package/dist/vendor/common-dtos/abac.policy.d.ts +10 -1
- package/dist/vendor/common-dtos/abac.policy.js +5 -2
- package/dist/vendor/common-dtos/audit.types.d.ts +1 -1
- package/dist/vendor/common-dtos/audit.types.js +0 -1
- package/dist/vendor/common-dtos/credential-requirements.d.ts +0 -1
- package/dist/vendor/common-dtos/credential-requirements.dto.d.ts +0 -1
- package/dist/vendor/common-dtos/credential-requirements.dto.js +0 -1
- package/dist/vendor/common-dtos/credential-requirements.js +0 -1
- package/dist/vendor/common-dtos/dataplane.dto.d.ts +0 -1
- package/dist/vendor/common-dtos/dataplane.dto.js +0 -1
- package/dist/vendor/common-dtos/dcp.dto.d.ts +0 -1
- package/dist/vendor/common-dtos/dcp.dto.js +0 -1
- package/dist/vendor/common-dtos/dcql.dto.d.ts +0 -1
- package/dist/vendor/common-dtos/dcql.dto.js +0 -1
- package/dist/vendor/common-dtos/did.schemas.d.ts +0 -1
- package/dist/vendor/common-dtos/did.schemas.js +0 -1
- package/dist/vendor/common-dtos/index.d.ts +1 -1
- package/dist/vendor/common-dtos/index.js +1 -1
- package/dist/vendor/common-dtos/metadata.dto.d.ts +0 -1
- package/dist/vendor/common-dtos/metadata.dto.js +0 -1
- package/dist/vendor/common-dtos/negotiations.dto.d.ts +2 -3
- package/dist/vendor/common-dtos/negotiations.dto.js +6 -7
- package/dist/vendor/common-dtos/permission-resources.d.ts +3 -0
- package/dist/vendor/common-dtos/permission-resources.js +18 -0
- package/dist/vendor/common-dtos/permissions.d.ts +6 -1
- package/dist/vendor/common-dtos/permissions.js +73 -1
- package/dist/vendor/common-dtos/presentation.request.dto.d.ts +0 -1
- package/dist/vendor/common-dtos/presentation.request.dto.js +0 -1
- package/dist/vendor/common-dtos/presentation.status.dto.d.ts +0 -1
- package/dist/vendor/common-dtos/presentation.status.dto.js +0 -1
- package/dist/vendor/common-dtos/presentationdefinition.dto.d.ts +0 -1
- package/dist/vendor/common-dtos/presentationdefinition.dto.js +0 -1
- package/dist/vendor/common-dtos/signatures.dto.d.ts +0 -1
- package/dist/vendor/common-dtos/signatures.dto.js +0 -1
- package/dist/vendor/common-dtos/transfer.dto.d.ts +0 -1
- package/dist/vendor/common-dtos/transfer.dto.js +0 -1
- package/dist/vendor/common-dtos/utils.swagger.d.ts +0 -1
- package/dist/vendor/common-dtos/utils.swagger.js +0 -1
- package/dist/vendor/control-plane-dtos/index.d.ts +0 -1
- package/dist/vendor/control-plane-dtos/index.js +0 -1
- package/dist/vendor/control-plane-dtos/registry/registry.dto.d.ts +0 -1
- package/dist/vendor/control-plane-dtos/registry/registry.dto.js +0 -1
- package/dist/vendor/control-plane-dtos/registry/registry.search.dto.d.ts +0 -1
- package/dist/vendor/control-plane-dtos/registry/registry.search.dto.js +0 -1
- package/dist/vendor/control-plane-dtos/ssi/verifiablePresentations.dto.d.ts +0 -1
- package/dist/vendor/control-plane-dtos/ssi/verifiablePresentations.dto.js +0 -1
- package/dist/vendor/control-plane-dtos/status/status.dto.d.ts +0 -1
- package/dist/vendor/control-plane-dtos/status/status.dto.js +0 -1
- package/dist/vendor/sso-bridge-dtos/clients.dto.d.ts +7 -4
- package/dist/vendor/sso-bridge-dtos/clients.dto.js +38 -4
- package/dist/vendor/sso-bridge-dtos/grants.d.ts +2 -1
- package/dist/vendor/sso-bridge-dtos/grants.js +7 -2
- package/dist/vendor/sso-bridge-dtos/index.d.ts +1 -1
- package/dist/vendor/sso-bridge-dtos/index.js +1 -1
- package/dist/vendor/sso-bridge-dtos/tenant.dto.d.ts +70 -0
- package/dist/vendor/sso-bridge-dtos/tenant.dto.js +1 -0
- package/dist/vendor/sso-bridge-dtos/users.dto.d.ts +19 -1
- package/dist/vendor/sso-bridge-dtos/users.dto.js +85 -2
- package/dist/vendor/tenant-dtos/authorization.dto.d.ts +46 -0
- package/dist/vendor/tenant-dtos/authorization.dto.js +5 -0
- package/dist/vendor/tenant-dtos/consumer.dto.d.ts +29 -0
- package/dist/vendor/tenant-dtos/consumer.dto.js +1 -0
- package/dist/vendor/tenant-dtos/fixtures.d.ts +15 -0
- package/dist/vendor/tenant-dtos/fixtures.js +48 -0
- package/dist/vendor/tenant-dtos/index.d.ts +8 -0
- package/dist/vendor/tenant-dtos/index.js +8 -0
- package/dist/vendor/tenant-dtos/management.dto.d.ts +137 -0
- package/dist/vendor/tenant-dtos/management.dto.js +1 -0
- package/dist/vendor/tenant-dtos/membership.dto.d.ts +22 -0
- package/dist/vendor/tenant-dtos/membership.dto.js +7 -0
- package/dist/vendor/tenant-dtos/principal.dto.d.ts +13 -0
- package/dist/vendor/tenant-dtos/principal.dto.js +6 -0
- package/dist/vendor/tenant-dtos/provisioning.dto.d.ts +47 -0
- package/dist/vendor/tenant-dtos/provisioning.dto.js +1 -0
- package/dist/vendor/tenant-dtos/service-binding.dto.d.ts +9 -0
- package/dist/vendor/tenant-dtos/service-binding.dto.js +1 -0
- package/dist/vendor/tenant-dtos/tenant.dto.d.ts +15 -0
- package/dist/vendor/tenant-dtos/tenant.dto.js +1 -0
- package/dist/vendor/wallet-dtos/clients.dto.d.ts +0 -1
- package/dist/vendor/wallet-dtos/clients.dto.js +0 -1
- package/dist/vendor/wallet-dtos/credentials.dto.d.ts +0 -1
- package/dist/vendor/wallet-dtos/credentials.dto.js +0 -1
- package/dist/vendor/wallet-dtos/index.d.ts +0 -1
- package/dist/vendor/wallet-dtos/index.js +0 -1
- package/dist/vendor/wallet-dtos/issuance.dto.d.ts +0 -1
- package/dist/vendor/wallet-dtos/issuance.dto.js +0 -1
- package/dist/vendor/wallet-dtos/scopes.dto.d.ts +0 -1
- package/dist/vendor/wallet-dtos/scopes.dto.js +0 -1
- package/dist/vendor/wallet-dtos/status.dto.d.ts +0 -1
- package/dist/vendor/wallet-dtos/status.dto.js +0 -1
- package/dist/vendor/wallet-dtos/utils/schema-converter.d.ts +0 -1
- package/dist/vendor/wallet-dtos/utils/schema-converter.js +0 -1
- package/dist/wallet/wallet.sdk.d.ts +3 -3
- package/dist/wallet/wallet.sdk.d.ts.map +1 -1
- package/dist/wallet/wallet.sdk.js.map +1 -1
- package/package.json +17 -16
|
@@ -9,6 +9,7 @@ export * from "./dcql.dto.js";
|
|
|
9
9
|
export * from "./did.schemas.js";
|
|
10
10
|
export * from "./metadata.dto.js";
|
|
11
11
|
export * from "./negotiations.dto.js";
|
|
12
|
+
export * from "./permission-resources.js";
|
|
12
13
|
export * from "./permissions.js";
|
|
13
14
|
export * from "./presentation.request.dto.js";
|
|
14
15
|
export * from "./presentation.status.dto.js";
|
|
@@ -16,4 +17,3 @@ export * from "./presentationdefinition.dto.js";
|
|
|
16
17
|
export * from "./signatures.dto.js";
|
|
17
18
|
export * from "./transfer.dto.js";
|
|
18
19
|
export * from "./utils.swagger.js";
|
|
19
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -9,6 +9,7 @@ export * from "./dcql.dto.js";
|
|
|
9
9
|
export * from "./did.schemas.js";
|
|
10
10
|
export * from "./metadata.dto.js";
|
|
11
11
|
export * from "./negotiations.dto.js";
|
|
12
|
+
export * from "./permission-resources.js";
|
|
12
13
|
export * from "./permissions.js";
|
|
13
14
|
export * from "./presentation.request.dto.js";
|
|
14
15
|
export * from "./presentation.status.dto.js";
|
|
@@ -16,4 +17,3 @@ export * from "./presentationdefinition.dto.js";
|
|
|
16
17
|
export * from "./signatures.dto.js";
|
|
17
18
|
export * from "./transfer.dto.js";
|
|
18
19
|
export * from "./utils.swagger.js";
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AgreementDto, ContractAgreementVerificationMessageDto, ContractNegotiationState, HashedMessage,
|
|
1
|
+
import { AgreementDto, ContractAgreementVerificationMessageDto, ContractNegotiationState, HashedMessage, OfferDto } from "@tsg-dsp/common-dsp";
|
|
2
2
|
export type NegotiationRole = "provider" | "consumer";
|
|
3
3
|
export declare class NegotiationProcessEventDto {
|
|
4
4
|
time: Date;
|
|
5
5
|
state: ContractNegotiationState;
|
|
6
6
|
localMessage?: string;
|
|
7
7
|
code?: string;
|
|
8
|
-
reason?:
|
|
8
|
+
reason?: unknown[];
|
|
9
9
|
agreementMessage?: string;
|
|
10
10
|
verification?: ContractAgreementVerificationMessageDto;
|
|
11
11
|
hashedMessage?: HashedMessage;
|
|
@@ -26,4 +26,3 @@ export declare class NegotiationDetailDto extends NegotiationStatusDto {
|
|
|
26
26
|
agreement?: AgreementDto;
|
|
27
27
|
events: Array<NegotiationProcessEventDto>;
|
|
28
28
|
}
|
|
29
|
-
//# sourceMappingURL=negotiations.dto.d.ts.map
|
|
@@ -8,9 +8,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
|
11
|
-
import { AgreementSchema, ContractAgreementVerificationMessageSchema, ContractNegotiationState, HashedMessageSchema,
|
|
11
|
+
import { AgreementSchema, ContractAgreementVerificationMessageSchema, ContractNegotiationState, HashedMessageSchema, OfferSchema } from "@tsg-dsp/common-dsp";
|
|
12
12
|
import { Type } from "class-transformer";
|
|
13
|
-
import { IsDate, IsEnum, IsOptional, IsString, ValidateNested } from "class-validator";
|
|
13
|
+
import { IsArray, IsDate, IsEnum, IsOptional, IsString, ValidateNested } from "class-validator";
|
|
14
14
|
export class NegotiationProcessEventDto {
|
|
15
15
|
time;
|
|
16
16
|
state;
|
|
@@ -56,12 +56,12 @@ __decorate([
|
|
|
56
56
|
], NegotiationProcessEventDto.prototype, "code", void 0);
|
|
57
57
|
__decorate([
|
|
58
58
|
ApiPropertyOptional({
|
|
59
|
-
type:
|
|
60
|
-
|
|
59
|
+
type: "array",
|
|
60
|
+
items: {},
|
|
61
|
+
example: ["Negotiation terminated by remote participant"]
|
|
61
62
|
}),
|
|
62
63
|
IsOptional(),
|
|
63
|
-
|
|
64
|
-
Type(() => MultilanguageSchema),
|
|
64
|
+
IsArray(),
|
|
65
65
|
__metadata("design:type", Array)
|
|
66
66
|
], NegotiationProcessEventDto.prototype, "reason", void 0);
|
|
67
67
|
__decorate([
|
|
@@ -202,4 +202,3 @@ __decorate([
|
|
|
202
202
|
Type(() => NegotiationProcessEventDto),
|
|
203
203
|
__metadata("design:type", Array)
|
|
204
204
|
], NegotiationDetailDto.prototype, "events", void 0);
|
|
205
|
-
//# sourceMappingURL=negotiations.dto.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { parsePermission, permission, Resource } from "./permissions.js";
|
|
2
|
+
/** Configuration shorthand expands to concrete resources before entering canonical grants. */
|
|
3
|
+
export function expandPermissionResources(values) {
|
|
4
|
+
return [
|
|
5
|
+
...new Set(values.flatMap((value) => {
|
|
6
|
+
const parsed = parsePermission(value);
|
|
7
|
+
if (!parsed.resource.includes("*"))
|
|
8
|
+
return [value];
|
|
9
|
+
const pattern = new RegExp(`^${parsed.resource
|
|
10
|
+
.split("*")
|
|
11
|
+
.map((part) => part.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"))
|
|
12
|
+
.join(".*")}$`);
|
|
13
|
+
return Object.values(Resource)
|
|
14
|
+
.filter((resource) => pattern.test(resource))
|
|
15
|
+
.map((resource) => permission(parsed.action, resource, parsed.scope));
|
|
16
|
+
}))
|
|
17
|
+
];
|
|
18
|
+
}
|
|
@@ -77,10 +77,16 @@ export interface Permission {
|
|
|
77
77
|
export type PermissionString = `${Action}:${Resource}` | `${Action}:${Resource}:${string}`;
|
|
78
78
|
export declare function permission(action: Action, resource: Resource, scope?: string | string[]): PermissionString;
|
|
79
79
|
export declare function parsePermission(perm: PermissionString): Permission;
|
|
80
|
+
/** Validate permission syntax consistently before issuing or consuming grants. */
|
|
81
|
+
export declare function validatePermission(perm: PermissionString): void;
|
|
80
82
|
export declare function permissionAllowsResourceId(perm: Permission, resourceId: string): boolean;
|
|
81
83
|
export declare function isOwnScope(perm: Permission): boolean;
|
|
82
84
|
export declare function isAllScope(perm: Permission): boolean;
|
|
83
85
|
export declare function isSpecificScope(perm: Permission): boolean;
|
|
86
|
+
/** Whether a permission is bounded by the union of the existing grants. */
|
|
87
|
+
export declare function permissionIsCovered(requested: PermissionString, granted: readonly PermissionString[]): boolean;
|
|
88
|
+
/** Intersect action/resource scopes without widening either set of grants. */
|
|
89
|
+
export declare function intersectPermissions(requested: readonly PermissionString[], granted: readonly PermissionString[]): PermissionString[];
|
|
84
90
|
export declare const Permissions: {
|
|
85
91
|
readonly CP_CATALOG_READ: PermissionString;
|
|
86
92
|
readonly CP_CATALOG_CREATE: PermissionString;
|
|
@@ -234,4 +240,3 @@ export declare const Permissions: {
|
|
|
234
240
|
readonly SSO_AUDIT_LOG_READ: PermissionString;
|
|
235
241
|
readonly SSO_AUDIT_LOG_MANAGE: PermissionString;
|
|
236
242
|
};
|
|
237
|
-
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -133,6 +133,14 @@ export function parsePermission(perm) {
|
|
|
133
133
|
}
|
|
134
134
|
return result;
|
|
135
135
|
}
|
|
136
|
+
/** Validate permission syntax consistently before issuing or consuming grants. */
|
|
137
|
+
export function validatePermission(perm) {
|
|
138
|
+
const parsed = parsePermission(perm);
|
|
139
|
+
if (!Object.values(Action).includes(parsed.action) ||
|
|
140
|
+
!parsed.resource ||
|
|
141
|
+
(Array.isArray(parsed.scope) && parsed.scope.some((scope) => !scope)))
|
|
142
|
+
throw new Error(`Invalid permission format: ${perm}`);
|
|
143
|
+
}
|
|
136
144
|
export function permissionAllowsResourceId(perm, resourceId) {
|
|
137
145
|
if (!perm.scope || perm.scope === RESERVED_SCOPES.ALL) {
|
|
138
146
|
return true;
|
|
@@ -160,6 +168,71 @@ export function isSpecificScope(perm) {
|
|
|
160
168
|
return false;
|
|
161
169
|
return true;
|
|
162
170
|
}
|
|
171
|
+
/** Whether a permission is bounded by the union of the existing grants. */
|
|
172
|
+
export function permissionIsCovered(requested, granted) {
|
|
173
|
+
try {
|
|
174
|
+
const required = parsePermission(requested);
|
|
175
|
+
if (!Object.values(Action).includes(required.action) || !required.resource)
|
|
176
|
+
return false;
|
|
177
|
+
const candidates = granted
|
|
178
|
+
.map(parsePermission)
|
|
179
|
+
.filter((p) => p.resource === required.resource &&
|
|
180
|
+
(p.action === required.action ||
|
|
181
|
+
(p.action === Action.MANAGE && required.action !== Action.MANAGE)));
|
|
182
|
+
if (candidates.some(isAllScope))
|
|
183
|
+
return true;
|
|
184
|
+
if (isAllScope(required))
|
|
185
|
+
return false;
|
|
186
|
+
if (isOwnScope(required))
|
|
187
|
+
return candidates.some(isOwnScope);
|
|
188
|
+
const ids = Array.isArray(required.scope)
|
|
189
|
+
? required.scope
|
|
190
|
+
: [required.scope];
|
|
191
|
+
return ids.every((id) => candidates.some((p) => permissionAllowsResourceId(p, id)));
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/** Intersect action/resource scopes without widening either set of grants. */
|
|
198
|
+
export function intersectPermissions(requested, granted) {
|
|
199
|
+
const result = new Set();
|
|
200
|
+
for (const requestedPermission of requested) {
|
|
201
|
+
const required = parsePermission(requestedPermission);
|
|
202
|
+
for (const grantedPermission of granted) {
|
|
203
|
+
const grant = parsePermission(grantedPermission);
|
|
204
|
+
if (required.resource !== grant.resource ||
|
|
205
|
+
!Object.values(Action).includes(required.action) ||
|
|
206
|
+
!Object.values(Action).includes(grant.action))
|
|
207
|
+
continue;
|
|
208
|
+
const action = required.action === Action.MANAGE
|
|
209
|
+
? grant.action
|
|
210
|
+
: grant.action === Action.MANAGE || grant.action === required.action
|
|
211
|
+
? required.action
|
|
212
|
+
: undefined;
|
|
213
|
+
if (!action)
|
|
214
|
+
continue;
|
|
215
|
+
if (isAllScope(required)) {
|
|
216
|
+
result.add(permission(action, grant.resource, grant.scope));
|
|
217
|
+
}
|
|
218
|
+
else if (isAllScope(grant)) {
|
|
219
|
+
result.add(permission(action, required.resource, required.scope));
|
|
220
|
+
}
|
|
221
|
+
else if (isOwnScope(required) || isOwnScope(grant)) {
|
|
222
|
+
// Ownership cannot be inferred from an explicit resource ID alone.
|
|
223
|
+
if (isOwnScope(required) && isOwnScope(grant)) {
|
|
224
|
+
result.add(permission(action, required.resource, RESERVED_SCOPES.OWN));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
const ids = (Array.isArray(required.scope) ? required.scope : [required.scope]).filter((id) => permissionAllowsResourceId(grant, id));
|
|
229
|
+
if (ids.length)
|
|
230
|
+
result.add(permission(action, required.resource, ids));
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return [...result];
|
|
235
|
+
}
|
|
163
236
|
export const Permissions = {
|
|
164
237
|
// ===========================================
|
|
165
238
|
// Control Plane Permissions (cp.*)
|
|
@@ -334,4 +407,3 @@ export const Permissions = {
|
|
|
334
407
|
SSO_AUDIT_LOG_READ: permission(Action.READ, Resource.SSO_AUDIT_LOG),
|
|
335
408
|
SSO_AUDIT_LOG_MANAGE: permission(Action.MANAGE, Resource.SSO_AUDIT_LOG)
|
|
336
409
|
};
|
|
337
|
-
//# sourceMappingURL=permissions.js.map
|
|
@@ -10,4 +10,3 @@ export declare const ApiNotFoundResponseDefault: (options?: ApiResponseOptions)
|
|
|
10
10
|
export declare const ApiConflictResponseDefault: (options?: ApiResponseOptions) => MethodDecorator & ClassDecorator;
|
|
11
11
|
export declare const ApiForbiddenResponseDefault: (options?: ApiResponseOptions) => MethodDecorator & ClassDecorator;
|
|
12
12
|
export declare const ApiBadRequestResponseDefault: (options?: ApiResponseOptions) => MethodDecorator & ClassDecorator;
|
|
13
|
-
//# sourceMappingURL=utils.swagger.d.ts.map
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import { ClientAuthMethod, GrantType } from "./grants.js";
|
|
1
|
+
import { ClientAuthMethod, ClientKind, GrantType } from "./grants.js";
|
|
2
2
|
export declare class ClientDto {
|
|
3
|
+
kind: ClientKind;
|
|
4
|
+
tenantId?: string;
|
|
5
|
+
audiences?: string[];
|
|
6
|
+
scopes?: string[];
|
|
3
7
|
id?: string;
|
|
4
8
|
name: string;
|
|
5
|
-
secretName
|
|
9
|
+
secretName?: string;
|
|
6
10
|
description: string;
|
|
7
11
|
clientId: string;
|
|
8
12
|
clientSecret?: string;
|
|
9
13
|
tokenEndpointAuthMethod?: ClientAuthMethod;
|
|
10
14
|
jwk?: Record<string, any>;
|
|
11
15
|
permissions: string[];
|
|
12
|
-
grants
|
|
16
|
+
grants?: GrantType[];
|
|
13
17
|
redirectUris: string[];
|
|
14
18
|
}
|
|
15
19
|
declare const CreateClientDto_base: import("@nestjs/common").Type<Omit<ClientDto, "id">>;
|
|
@@ -19,4 +23,3 @@ declare const UpdateClientDto_base: import("@nestjs/common").Type<Partial<Omit<C
|
|
|
19
23
|
export declare class UpdateClientDto extends UpdateClientDto_base {
|
|
20
24
|
}
|
|
21
25
|
export {};
|
|
22
|
-
//# sourceMappingURL=clients.dto.d.ts.map
|
|
@@ -10,6 +10,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
import { ApiProperty, ApiPropertyOptional, OmitType, PartialType } from "@nestjs/swagger";
|
|
11
11
|
import { IsArray, IsIn, IsNotEmpty, IsObject, IsOptional, IsString } from "class-validator";
|
|
12
12
|
export class ClientDto {
|
|
13
|
+
kind;
|
|
14
|
+
tenantId;
|
|
15
|
+
audiences;
|
|
16
|
+
scopes;
|
|
13
17
|
id;
|
|
14
18
|
name;
|
|
15
19
|
secretName;
|
|
@@ -22,6 +26,33 @@ export class ClientDto {
|
|
|
22
26
|
grants;
|
|
23
27
|
redirectUris;
|
|
24
28
|
}
|
|
29
|
+
__decorate([
|
|
30
|
+
ApiProperty({ enum: ["shared", "workload", "platform"] }),
|
|
31
|
+
IsIn(["shared", "workload", "platform"]),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], ClientDto.prototype, "kind", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
ApiPropertyOptional({
|
|
36
|
+
description: "Canonical tenant UUID for a workload client"
|
|
37
|
+
}),
|
|
38
|
+
IsString(),
|
|
39
|
+
IsOptional(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], ClientDto.prototype, "tenantId", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
ApiPropertyOptional({ description: "Registered resource audiences" }),
|
|
44
|
+
IsString({ each: true }),
|
|
45
|
+
IsArray(),
|
|
46
|
+
IsOptional(),
|
|
47
|
+
__metadata("design:type", Array)
|
|
48
|
+
], ClientDto.prototype, "audiences", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
ApiPropertyOptional({ description: "Allowed OAuth scopes" }),
|
|
51
|
+
IsString({ each: true }),
|
|
52
|
+
IsArray(),
|
|
53
|
+
IsOptional(),
|
|
54
|
+
__metadata("design:type", Array)
|
|
55
|
+
], ClientDto.prototype, "scopes", void 0);
|
|
25
56
|
__decorate([
|
|
26
57
|
ApiPropertyOptional({ example: "1" }),
|
|
27
58
|
IsString(),
|
|
@@ -35,9 +66,9 @@ __decorate([
|
|
|
35
66
|
__metadata("design:type", String)
|
|
36
67
|
], ClientDto.prototype, "name", void 0);
|
|
37
68
|
__decorate([
|
|
38
|
-
|
|
69
|
+
ApiPropertyOptional({ example: "SecretExample" }),
|
|
39
70
|
IsString(),
|
|
40
|
-
|
|
71
|
+
IsOptional(),
|
|
41
72
|
__metadata("design:type", String)
|
|
42
73
|
], ClientDto.prototype, "secretName", void 0);
|
|
43
74
|
__decorate([
|
|
@@ -96,9 +127,13 @@ __decorate([
|
|
|
96
127
|
__metadata("design:type", Array)
|
|
97
128
|
], ClientDto.prototype, "permissions", void 0);
|
|
98
129
|
__decorate([
|
|
99
|
-
|
|
130
|
+
ApiPropertyOptional({
|
|
131
|
+
example: ["client_credentials", "authorization_code", "refresh_token"],
|
|
132
|
+
description: "On creation, defaults to authorization_code and refresh_token for shared clients; client_credentials for workload/platform clients. Omission during updates preserves the stored policy."
|
|
133
|
+
}),
|
|
100
134
|
IsArray(),
|
|
101
135
|
IsNotEmpty(),
|
|
136
|
+
IsOptional(),
|
|
102
137
|
__metadata("design:type", Array)
|
|
103
138
|
], ClientDto.prototype, "grants", void 0);
|
|
104
139
|
__decorate([
|
|
@@ -110,4 +145,3 @@ export class CreateClientDto extends OmitType(ClientDto, ["id"]) {
|
|
|
110
145
|
}
|
|
111
146
|
export class UpdateClientDto extends PartialType(OmitType(ClientDto, ["id"])) {
|
|
112
147
|
}
|
|
113
|
-
//# sourceMappingURL=clients.dto.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type GrantType = "authorization_code" | "refresh_token" | "client_credentials" | "password";
|
|
2
2
|
export type ClientAuthMethod = "client_secret_post" | "private_key_jwt" | "none";
|
|
3
|
-
|
|
3
|
+
export type ClientKind = "shared" | "workload" | "platform";
|
|
4
|
+
export declare function getDefaultClientGrants(kind: ClientKind): GrantType[];
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export function getDefaultClientGrants(kind) {
|
|
2
|
+
if (kind === "shared")
|
|
3
|
+
return ["authorization_code", "refresh_token"];
|
|
4
|
+
if (kind === "workload" || kind === "platform")
|
|
5
|
+
return ["client_credentials"];
|
|
6
|
+
throw new Error("Explicit valid client kind required");
|
|
7
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { EnsureTenantRequest, PrincipalRef, TenantProvisioningResult, TenantRole, TenantState } from "../tenant-dtos/index.js";
|
|
2
|
+
import type { CreateClientDto } from "./clients.dto.js";
|
|
3
|
+
export interface SsoServiceBinding {
|
|
4
|
+
serviceInstanceId: string;
|
|
5
|
+
audience: string;
|
|
6
|
+
localTenantSlug?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SsoTenantConfiguration {
|
|
9
|
+
services: SsoServiceBinding[];
|
|
10
|
+
/** Workload credentials only. Global browser/platform clients are operator-controlled. */
|
|
11
|
+
clients: CreateClientDto[];
|
|
12
|
+
}
|
|
13
|
+
export type EnsureSsoTenantRequest = EnsureTenantRequest<SsoTenantConfiguration>;
|
|
14
|
+
export type SsoTenantProvisioningResult = TenantProvisioningResult<{
|
|
15
|
+
issuer: string;
|
|
16
|
+
clientIds: string[];
|
|
17
|
+
}> & {
|
|
18
|
+
appliedLifecycleRevision: number;
|
|
19
|
+
};
|
|
20
|
+
export interface SsoTenantSummary {
|
|
21
|
+
id: string;
|
|
22
|
+
slug: string;
|
|
23
|
+
name: string;
|
|
24
|
+
permissions: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface SsoTenantMembershipSummary {
|
|
27
|
+
tenantId: string;
|
|
28
|
+
name: string;
|
|
29
|
+
slug: string;
|
|
30
|
+
role: TenantRole;
|
|
31
|
+
status: "active" | "revoked";
|
|
32
|
+
tenantState: TenantState;
|
|
33
|
+
authorizationStatus: "current" | "stale";
|
|
34
|
+
}
|
|
35
|
+
export interface SsoPlatformTenantSummary {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
slug: string;
|
|
39
|
+
state: TenantState;
|
|
40
|
+
memberCount: number;
|
|
41
|
+
authorizationStatus: "current" | "stale" | "unavailable";
|
|
42
|
+
}
|
|
43
|
+
export interface ResolveSsoAccountRequest {
|
|
44
|
+
principal: PrincipalRef;
|
|
45
|
+
}
|
|
46
|
+
export interface SsoAccountSummary {
|
|
47
|
+
principal: PrincipalRef;
|
|
48
|
+
name: string;
|
|
49
|
+
}
|
|
50
|
+
export interface LookupSsoAccountRequest {
|
|
51
|
+
username: string;
|
|
52
|
+
}
|
|
53
|
+
export interface BootstrapSsoAccountRequest {
|
|
54
|
+
operationId: string;
|
|
55
|
+
tenantId: string;
|
|
56
|
+
userId: string;
|
|
57
|
+
username: string;
|
|
58
|
+
email: string;
|
|
59
|
+
}
|
|
60
|
+
export interface BootstrapSsoAccountResult {
|
|
61
|
+
principal: PrincipalRef;
|
|
62
|
+
setupPending: boolean;
|
|
63
|
+
notificationSent: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface SsoAccountSetupLink {
|
|
66
|
+
/** Present only when email delivery is disabled. */
|
|
67
|
+
url?: string;
|
|
68
|
+
expiresAt: number;
|
|
69
|
+
notificationSent: boolean;
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|