78 lines
2.4 KiB
TypeScript
78 lines
2.4 KiB
TypeScript
export type CredentialOutcome = 'ok' | 'refused' | 'error' | 'indeterminate';
|
|
export type CredentialMutationState = 'none' | 'not-started' | 'applied' | 'unknown';
|
|
export type RepositoryPermission = 'none' | 'read' | 'write' | 'admin';
|
|
export type ReceivePackState = 'advertised' | 'refused';
|
|
|
|
export interface CredentialReasonDto {
|
|
readonly code: string;
|
|
readonly message: string;
|
|
}
|
|
|
|
export interface CredentialSubjectDto {
|
|
readonly identity: string;
|
|
readonly estate: string;
|
|
readonly host: string;
|
|
readonly repo: string;
|
|
}
|
|
|
|
export interface ProviderIdentityEvidenceDto {
|
|
readonly login: string;
|
|
readonly endpoint: string;
|
|
readonly contentType: string;
|
|
}
|
|
|
|
export interface RepositoryPermissionEvidenceDto {
|
|
readonly effective: RepositoryPermission;
|
|
readonly endpoint: string;
|
|
readonly contentType: string;
|
|
}
|
|
|
|
export interface ReceivePackEvidenceDto {
|
|
readonly state: ReceivePackState;
|
|
readonly principal: string | null;
|
|
readonly resolutionId: string | null;
|
|
readonly contentType: string;
|
|
}
|
|
|
|
export interface ReadOnlyControlEvidenceDto {
|
|
readonly identity: string;
|
|
readonly providerPermission: RepositoryPermission;
|
|
readonly receivePack: ReceivePackState;
|
|
}
|
|
|
|
export interface WriteDifferentialEvidenceDto {
|
|
readonly state: 'can-write';
|
|
readonly credentialBinding: 'same-resolution';
|
|
readonly transportPrincipal: string;
|
|
readonly authenticatedReceivePack: 'advertised';
|
|
readonly readOnlyControl: ReadOnlyControlEvidenceDto;
|
|
readonly unauthenticatedReceivePack: 'refused';
|
|
readonly artifactCreated: false;
|
|
readonly proves: string;
|
|
readonly doesNotProve: string;
|
|
}
|
|
|
|
export interface CredentialValidationEvidenceDto {
|
|
readonly providerIdentity: ProviderIdentityEvidenceDto | null;
|
|
readonly repositoryPermission: RepositoryPermissionEvidenceDto | null;
|
|
readonly writeDifferential: WriteDifferentialEvidenceDto | null;
|
|
}
|
|
|
|
export interface CredentialAuditResultDto {
|
|
readonly journalId: string | null;
|
|
readonly state: 'not-started' | 'open' | 'sealed';
|
|
}
|
|
|
|
export interface CredentialValidationResultDto {
|
|
readonly schemaVersion: 1;
|
|
readonly operation: 'validate';
|
|
readonly outcome: CredentialOutcome;
|
|
readonly exitCode: 0 | 10 | 20 | 30;
|
|
readonly retryable: boolean;
|
|
readonly subject: CredentialSubjectDto;
|
|
readonly mutation: CredentialMutationState;
|
|
readonly reason: CredentialReasonDto;
|
|
readonly evidence: CredentialValidationEvidenceDto;
|
|
readonly audit: CredentialAuditResultDto;
|
|
}
|