Skip to content

Commit f0e4d25

Browse files
committed
feat: seperate mdoc builder method
Signed-off-by: Tipu_Singh <[email protected]>
1 parent 74760b9 commit f0e4d25

File tree

11 files changed

+508
-34
lines changed

11 files changed

+508
-34
lines changed

apps/api-gateway/src/oid4vc-issuance/dtos/issuer-sessions.dto.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -157,25 +157,16 @@ export class CreateOidcCredentialOfferDto {
157157
@Type(() => CredentialRequestDto)
158158
credentials!: CredentialRequestDto[];
159159

160-
// XOR: exactly one present
161-
@ApiPropertyOptional({ type: PreAuthorizedCodeFlowConfigDto })
162-
@IsOptional()
163-
@ValidateNested()
164-
@Type(() => PreAuthorizedCodeFlowConfigDto)
165-
preAuthorizedCodeFlowConfig?: PreAuthorizedCodeFlowConfigDto;
166-
167-
@IsOptional()
168-
@ValidateNested()
169-
@Type(() => AuthorizationCodeFlowConfigDto)
170-
authorizationCodeFlowConfig?: AuthorizationCodeFlowConfigDto;
160+
@ApiProperty({
161+
example: 'preAuthorizedCodeFlow',
162+
enum: ['preAuthorizedCodeFlow', 'authorizationCodeFlow'],
163+
description: 'Authorization type'
164+
})
165+
@IsString()
166+
@IsIn(['preAuthorizedCodeFlow', 'authorizationCodeFlow'])
167+
authorizationType!: 'preAuthorizedCodeFlow' | 'authorizationCodeFlow';
171168

172169
issuerId?: string;
173-
174-
// host XOR rule
175-
@ExactlyOneOf(['preAuthorizedCodeFlowConfig', 'authorizationCodeFlowConfig'], {
176-
message: 'Provide exactly one of preAuthorizedCodeFlowConfig or authorizationCodeFlowConfig.'
177-
})
178-
private readonly _exactlyOne?: unknown;
179170
}
180171

181172
export class GetAllCredentialOfferDto {

apps/api-gateway/src/oid4vc-issuance/dtos/oid4vc-issuer.dto.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@ export class IssuerCreationDto {
246246
@Type(() => DisplayDto)
247247
display: DisplayDto[];
248248

249+
@ApiProperty({ example: 'https://auth.example.org', description: 'Authorization URL' })
250+
@IsUrl({ require_tld: false })
251+
authorizationServerUrl: string;
252+
249253
@ApiProperty({
250254
description: 'Configuration of the authorization server',
251255
type: AuthorizationServerConfigDto

apps/api-gateway/src/oid4vc-issuance/oid4vc-issuance.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ export class Oid4vcIssuanceController {
437437
@Post('/orgs/:orgId/oid4vc/:issuerId/create-offer')
438438
@ApiOperation({
439439
summary: 'Create OID4VC Credential Offer',
440-
description: 'Creates a new OIDC4VCI credential-offer for a given issuer.'
440+
description: 'Creates a new OID4VC credential-offer for a given issuer.'
441441
})
442442
@ApiResponse({ status: HttpStatus.CREATED, description: 'Credential offer created successfully.' })
443443
@ApiBearerAuth()

apps/oid4vc-issuance/interfaces/oid4vc-issuance.interfaces.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ export interface AuthorizationServerConfig {
5757
}
5858

5959
export interface IssuerCreation {
60+
authorizationServerUrl: string;
6061
issuerId: string;
6162
accessTokenSignerKeyType?: AccessTokenSignerKeyType;
6263
display: Display[];
6364
dpopSigningAlgValuesSupported?: string[];
64-
// credentialConfigurationsSupported?: Record<string, CredentialConfiguration>; // Not used
6565
authorizationServerConfigs: AuthorizationServerConfig;
6666
batchCredentialIssuanceSize: number;
6767
}
@@ -79,6 +79,7 @@ export interface IssuerInitialConfig {
7979
}
8080

8181
export interface IssuerMetadata {
82+
authorizationServerUrl: string;
8283
publicIssuerId: string;
8384
createdById: string;
8485
orgAgentId: string;

0 commit comments

Comments
 (0)