Skip to content

Commit

Permalink
fix: resolved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghadi8 committed Sep 16, 2024
2 parents ec9947c + 2f424a5 commit 15f8c62
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 34 deletions.
68 changes: 41 additions & 27 deletions apps/vc-api/src/external/credentials/credential.agent.initiator.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,58 @@
import { Injectable } from '@nestjs/common';
import type { ICredentialPlugin, IDIDManager, IIdentifier, IKeyManager, IResolver, TAgent } from '@veramo/core';
import type {
ICredentialPlugin,
IDIDManager,
IIdentifier,
IKeyManager,
IResolver,
TAgent,
} from '@veramo/core';
import type { ICredentialIssuerEIP712 } from '@veramo/credential-eip712';
import type { } from '@veramo/did-manager'
import type { } from '@veramo/key-manager';
import type { } from '@veramo/kms-local';
import type { } from '@veramo/did-provider-ethr';
import type { } from '@veramo/did-resolver';
import type { } from '@veramo/credential-w3c';
import type { } from '@veramo/credential-ld';
import { } from '@veramo/credential-ld';
import type {} from '@veramo/did-manager';
import type {} from '@veramo/key-manager';
import type {} from '@veramo/kms-local';
import type {} from '@veramo/did-provider-ethr';
import type {} from '@veramo/did-resolver';
import type {} from '@veramo/credential-w3c';
import type {} from '@veramo/credential-ld';
import {} from '@veramo/credential-ld';


export type Agent = TAgent<IDIDManager & IKeyManager & IResolver & ICredentialPlugin & ICredentialIssuerEIP712>
export type Identifier = IIdentifier
export type Agent = TAgent<
IDIDManager &
IKeyManager &
IResolver &
ICredentialPlugin &
ICredentialIssuerEIP712
>;
export type Identifier = IIdentifier;

@Injectable()
export class CredentialAgentInitiator {

agent: Agent;
constructor(
agent: Agent,
) {
this.agent = agent;
constructor(agent: Agent) {
this.agent = agent;
}

async createAgentWithIdentifier(ensDomain: string, publicKey: string, privateKey: string): Promise<{
agent: Agent,
identifier: Identifier
async createAgentWithIdentifier(
ensDomain: string,
publicKey: string,
privateKey: string
): Promise<{
agent: Agent;
identifier: Identifier;
}> {
const identifier = await this.agent.didManagerImport({
did: 'did:ens:' + ensDomain + '#' + publicKey,
provider: 'did:ens',
keys: [{
privateKeyHex: privateKey,
type: 'Secp256k1',
kms: 'local'
}]
keys: [
{
privateKeyHex: privateKey,
type: 'Secp256k1',
kms: 'local',
},
],
});


return { agent: this.agent, identifier }
return { agent: this.agent, identifier };
}
}
18 changes: 18 additions & 0 deletions k8s-staging/kong-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kong-alb
namespace: verifications-staging-namespace
spec:
ingressClassName: kong
rules:
- host: api-staging.justaname.id
http:
paths:
- path: /verifications/v1
pathType: Prefix
backend:
service:
name: vc-api-service
port:
number: 3009
2 changes: 1 addition & 1 deletion k8s-staging/staging-secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: secrets-manager-access-sa
namespace: verifications-staging-namespace
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::905418196669:role/justaname-staging-cluster-eksClusterRole
eks.amazonaws.com/role-arn: arn:aws:iam::${AWS_ID}:role/justaname-staging-cluster-eksClusterRole
---
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
Expand Down
4 changes: 2 additions & 2 deletions k8s-staging/vc-api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ spec:
volumeAttributes:
secretProviderClass: "aws-secrets"
containers:
- name: analytics
image: 905418196669.dkr.ecr.eu-central-1.amazonaws.com/justaname/vc-api:latest
- name: vc-api
image: ${AWS_ID}.dkr.ecr.eu-central-1.amazonaws.com/justaname/vc-api:latest
ports:
- containerPort: 3009
volumeMounts:
Expand Down
18 changes: 18 additions & 0 deletions k8s/kong-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: kong-alb-production
namespace: verifications-namespace
spec:
ingressClassName: kong
rules:
- host: api.justaname.id
http:
paths:
- path: /verifications/v1
pathType: Prefix
backend:
service:
name: vc-api-service
port:
number: 3009
2 changes: 1 addition & 1 deletion k8s/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: secrets-manager-access-sa
namespace: verifications-namespace
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::905418196669:role/justaname-cluster-eksClusterRole
eks.amazonaws.com/role-arn: arn:aws:iam::${AWS_ID}:role/justaname-production-cluster-eksClusterRole
---
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
Expand Down
6 changes: 3 additions & 3 deletions k8s/vc-api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
selector:
matchLabels:
app: vc-api
replicas: 1
replicas: 2
template:
metadata:
labels:
Expand All @@ -24,8 +24,8 @@ spec:
volumeAttributes:
secretProviderClass: "aws-secrets"
containers:
- name: analytics
image: 905418196669.dkr.ecr.eu-central-1.amazonaws.com/justaname-production/vc-api:latest
- name: vc-api
image: ${AWS_ID}.dkr.ecr.eu-central-1.amazonaws.com/justaname-production/vc-api:latest
ports:
- containerPort: 3009
volumeMounts:
Expand Down

0 comments on commit 15f8c62

Please sign in to comment.