- Add Legal Office of the Master seal (SVG design with Maltese Cross, scales of justice, legal scroll) - Create legal-office-manifest-template.json for Legal Office credentials - Update SEAL_MAPPING.md and DESIGN_GUIDE.md with Legal Office seal documentation - Complete Azure CDN infrastructure deployment: - Resource group, storage account, and container created - 17 PNG seal files uploaded to Azure Blob Storage - All manifest templates updated with Azure URLs - Configuration files generated (azure-cdn-config.env) - Add comprehensive Azure CDN setup scripts and documentation - Fix manifest URL generation to prevent double slashes - Verify all seals accessible via HTTPS
103 lines
3.1 KiB
TypeScript
103 lines
3.1 KiB
TypeScript
/**
|
|
* AWS Step Functions workflow orchestration integration
|
|
* Provides workflow orchestration capabilities for credential issuance and management
|
|
*/
|
|
|
|
export interface StepFunctionsConfig {
|
|
region?: string;
|
|
stateMachineArn?: string;
|
|
}
|
|
|
|
export interface CredentialIssuanceWorkflowInput {
|
|
subjectDid: string;
|
|
credentialType: string[];
|
|
credentialSubject: Record<string, unknown>;
|
|
expirationDate?: Date;
|
|
metadata?: Record<string, unknown>;
|
|
}
|
|
|
|
export interface CredentialIssuanceWorkflowOutput {
|
|
credentialId: string;
|
|
status: 'issued' | 'failed';
|
|
error?: string;
|
|
}
|
|
|
|
/**
|
|
* AWS Step Functions client (placeholder for actual Step Functions integration)
|
|
* In production, this would use @aws-sdk/client-sfn
|
|
*/
|
|
export class StepFunctionsWorkflowClient {
|
|
private config: Required<StepFunctionsConfig>;
|
|
|
|
constructor(config: StepFunctionsConfig = {}) {
|
|
this.config = {
|
|
region: config.region || 'us-east-1',
|
|
stateMachineArn: config.stateMachineArn || '',
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Start a credential issuance workflow
|
|
*/
|
|
async startCredentialIssuanceWorkflow(
|
|
input: CredentialIssuanceWorkflowInput
|
|
): Promise<string> {
|
|
// Placeholder: In production, this would use Step Functions client
|
|
// const client = new SFNClient({ region: this.config.region });
|
|
// const command = new StartExecutionCommand({
|
|
// stateMachineArn: this.config.stateMachineArn,
|
|
// input: JSON.stringify(input),
|
|
// });
|
|
// const response = await client.send(command);
|
|
// return response.executionArn;
|
|
|
|
console.log('Starting credential issuance workflow via Step Functions:', input);
|
|
return `arn:aws:states:${this.config.region}:123456789012:execution:credential-issuance:${Date.now()}`;
|
|
}
|
|
|
|
/**
|
|
* Get workflow execution status
|
|
*/
|
|
async getWorkflowStatus(_executionArn: string): Promise<{
|
|
status: 'running' | 'succeeded' | 'failed' | 'timed_out' | 'aborted';
|
|
result?: CredentialIssuanceWorkflowOutput;
|
|
error?: string;
|
|
}> {
|
|
// Placeholder: In production, this would query Step Functions
|
|
// const client = new SFNClient({ region: this.config.region });
|
|
// const command = new DescribeExecutionCommand({ executionArn });
|
|
// const response = await client.send(command);
|
|
// return { status: response.status, ... };
|
|
|
|
return {
|
|
status: 'running',
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Stop a workflow execution
|
|
*/
|
|
async stopWorkflow(executionArn: string, error?: string): Promise<void> {
|
|
// Placeholder: In production, this would stop via Step Functions client
|
|
// const client = new SFNClient({ region: this.config.region });
|
|
// const command = new StopExecutionCommand({ executionArn, error });
|
|
// await client.send(command);
|
|
|
|
console.log('Stopping workflow:', executionArn, error);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Get Step Functions workflow client instance
|
|
*/
|
|
let workflowClient: StepFunctionsWorkflowClient | null = null;
|
|
|
|
export function getStepFunctionsWorkflowClient(
|
|
config?: StepFunctionsConfig
|
|
): StepFunctionsWorkflowClient {
|
|
if (!workflowClient) {
|
|
workflowClient = new StepFunctionsWorkflowClient(config);
|
|
}
|
|
return workflowClient;
|
|
}
|