File
Description
An Attribute Provider is an external HTTPS endpoint called during
credential issuance to dynamically fetch claim values.
Attribute Providers are configured once per tenant and can be
referenced by multiple credential configurations via attributeProviderId.
|
Optional
description
|
Type : string | null
|
Decorators :
@IsOptional() @IsString() @Column('varchar', {nullable: true})
|
|
|
|
id
|
Type : string
|
Decorators :
@IsString() @PrimaryColumn('varchar')
|
|
|
|
name
|
Type : string
|
Decorators :
@IsString() @Column('varchar')
|
|
|
|
tenant
|
Type : TenantEntity
|
Decorators :
@ManyToOne(undefined, {cascade: true, onDelete: 'CASCADE'})
|
|
|
|
tenantId
|
Type : string
|
Decorators :
@Column('varchar', {primary: true})
|
|
|
|
url
|
Type : string
|
Decorators :
@IsString() @Column('varchar')
|
|
|
import { ApiProperty, getSchemaPath } from "@nestjs/swagger";
import { Type } from "class-transformer";
import { IsOptional, IsString, ValidateNested } from "class-validator";
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
import { TenantEntity } from "../../../../auth/tenant/entitites/tenant.entity";
import {
AuthConfig,
WebHookAuthConfig,
WebHookAuthConfigHeader,
WebHookAuthConfigNone,
} from "../../../../shared/utils/webhook/webhook.dto";
/**
* An Attribute Provider is an external HTTPS endpoint called during
* credential issuance to dynamically fetch claim values.
*
* Attribute Providers are configured once per tenant and can be
* referenced by multiple credential configurations via `attributeProviderId`.
*/
@Entity()
export class AttributeProviderEntity {
@IsString()
@PrimaryColumn("varchar")
id!: string;
@Column("varchar", { primary: true })
tenantId!: string;
@ManyToOne(() => TenantEntity, { cascade: true, onDelete: "CASCADE" })
tenant!: TenantEntity;
@IsString()
@Column("varchar")
name!: string;
@IsOptional()
@IsString()
@Column("varchar", { nullable: true })
description?: string | null;
@IsString()
@Column("varchar")
url!: string;
@ValidateNested()
@ApiProperty({
oneOf: [
{ $ref: getSchemaPath(WebHookAuthConfigNone) },
{ $ref: getSchemaPath(WebHookAuthConfigHeader) },
],
})
@Type(() => WebHookAuthConfig, {
discriminator: {
property: "type",
subTypes: [
{ name: AuthConfig.NONE, value: WebHookAuthConfigNone },
{ name: AuthConfig.API_KEY, value: WebHookAuthConfigHeader },
],
},
keepDiscriminatorProperty: true,
})
@Column("json")
auth!: WebHookAuthConfigNone | WebHookAuthConfigHeader;
}