src/auth/client/entities/client.entity.ts
Represents a client in the system that belongs to a tenant.
Properties |
|
| Optional allowedIssuanceConfigs |
Type : string[] | null
|
Decorators :
@ApiPropertyOptional({type: undefined, description: 'List of issuance config IDs this client can use. If empty/null, all configs are allowed.', example: undefined})
|
|
Defined in src/auth/client/entities/client.entity.ts:81
|
|
Optional list of issuance config IDs this client is allowed to use. If null or empty, the client can use all issuance configs (backward compatible). Only relevant if the client has the 'issuance:offer' role. |
| Optional allowedPresentationConfigs |
Type : string[] | null
|
Decorators :
@ApiPropertyOptional({type: undefined, description: 'List of presentation config IDs this client can use. If empty/null, all configs are allowed.', example: undefined})
|
|
Defined in src/auth/client/entities/client.entity.ts:67
|
|
Optional list of presentation config IDs this client is allowed to use. If null or empty, the client can use all presentation configs (backward compatible). Only relevant if the client has the 'presentation:request' role. |
| clientId |
Type : string
|
Decorators :
@ApiProperty({description: 'Unique client identifier'})
|
|
Defined in src/auth/client/entities/client.entity.ts:20
|
|
The unique identifier for the client. |
| Optional description |
Type : string
|
Decorators :
@ApiPropertyOptional({description: 'Client description'})
|
|
Defined in src/auth/client/entities/client.entity.ts:43
|
|
The description of the client. |
| roles |
Type : Role[]
|
Decorators :
@ApiProperty({description: 'Roles assigned to the client', type: undefined})
|
|
Defined in src/auth/client/entities/client.entity.ts:53
|
|
The roles assigned to the client. |
| Optional secret |
Type : string
|
Decorators :
@ApiHideProperty()
|
|
Defined in src/auth/client/entities/client.entity.ts:27
|
|
The secret key for the client. |
| Optional tenant |
Type : TenantEntity
|
Decorators :
@ApiHideProperty()
|
|
Defined in src/auth/client/entities/client.entity.ts:92
|
|
The tenant that the client belongs to. |
| Optional tenantId |
Type : string
|
Decorators :
@ApiPropertyOptional({description: 'Tenant identifier the client belongs to'})
|
|
Defined in src/auth/client/entities/client.entity.ts:36
|
|
The unique identifier for the tenant that the client belongs to. Only null for accounts that manage tenants, that do not belong to a client |
import {
ApiHideProperty,
ApiProperty,
ApiPropertyOptional,
} from "@nestjs/swagger";
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
import { Role } from "../../roles/role.enum";
import { TenantEntity } from "../../tenant/entities/tenant.entity";
/**
* Represents a client in the system that belongs to a tenant.
*/
@Entity()
export class ClientEntity {
/**
* The unique identifier for the client.
*/
@ApiProperty({ description: "Unique client identifier" })
@PrimaryColumn("varchar")
clientId!: string;
/**
* The secret key for the client.
*/
@ApiHideProperty()
@Column("varchar", { nullable: true })
secret?: string;
/**
* The unique identifier for the tenant that the client belongs to. Only null for accounts that manage tenants, that do not belong to a client
*/
@ApiPropertyOptional({
description: "Tenant identifier the client belongs to",
})
@Column("varchar", { nullable: true })
tenantId?: string;
/**
* The description of the client.
*/
@ApiPropertyOptional({ description: "Client description" })
@Column("varchar", { nullable: true })
description?: string;
/**
* The roles assigned to the client.
*/
@ApiProperty({
description: "Roles assigned to the client",
type: [String],
})
@Column({ type: "json" })
roles!: Role[];
/**
* Optional list of presentation config IDs this client is allowed to use.
* If null or empty, the client can use all presentation configs (backward compatible).
* Only relevant if the client has the 'presentation:request' role.
*/
@ApiPropertyOptional({
type: [String],
description:
"List of presentation config IDs this client can use. If empty/null, all configs are allowed.",
example: ["age-verification", "kyc-basic"],
})
@Column({ type: "json", nullable: true })
allowedPresentationConfigs?: string[] | null;
/**
* Optional list of issuance config IDs this client is allowed to use.
* If null or empty, the client can use all issuance configs (backward compatible).
* Only relevant if the client has the 'issuance:offer' role.
*/
@ApiPropertyOptional({
type: [String],
description:
"List of issuance config IDs this client can use. If empty/null, all configs are allowed.",
example: ["pid", "mdl"],
})
@Column({ type: "json", nullable: true })
allowedIssuanceConfigs?: string[] | null;
/**
* The tenant that the client belongs to.
*/
@ApiHideProperty()
@ManyToOne(
() => TenantEntity,
(tenant) => tenant.clients,
{ onDelete: "CASCADE" },
)
tenant?: TenantEntity;
}