Skip to content
Snippets Groups Projects
Unverified Commit 82943afd authored by Zdravko Iliev's avatar Zdravko Iliev
Browse files

feat: overwrite invitation url

parent dcd1e765
No related branches found
No related tags found
1 merge request!73feat: double invitation links
Pipeline #70230 passed with stage
in 3 minutes and 26 seconds
This commit is part of merge request !73. Comments created here will be created in the context of that merge request.
......@@ -75,6 +75,8 @@ spec:
value: {{ .Values.ocm.agent.api.basic.pass | quote }}
- name: AUTH_JWT_PUBLIC_KEY
value: {{ .Values.ocm.agent.api.jwt.publicKey | quote }}
- name: AGENT_OOB_URL
value: {{ .Values.ocm.agent.oob.url | quote }}
{{- else if eq .Release.Namespace "ocm-test" }}
- name: LEDGERS
value: {{ .Values.ocmtest.agent.ledgers | quote }}
......@@ -114,6 +116,8 @@ spec:
value: {{ .Values.ocmtest.agent.api.basic.pass | quote }}
- name: AUTH_JWT_PUBLIC_KEY
value: {{ .Values.ocmtest.agent.api.jwt.publicKey | quote }}
- name: AGENT_OOB_URL
value: {{ .Values.ocmtest.agent.oob.url | quote }}
{{- else if eq .Release.Namespace "hin" }}
- name: LEDGERS
value: {{ .Values.hin.agent.ledgers | quote }}
......@@ -157,6 +161,8 @@ spec:
value: {{ .Values.hin.agent.api.basic.pass | quote }}
- name: AUTH_JWT_PUBLIC_KEY
value: {{ .Values.hin.agent.api.jwt.publicKey | quote }}
- name: AGENT_OOB_URL
value: {{ .Values.hin.agent.oob.url | quote }}
{{- else if eq .Release.Namespace "cloud-auth" }}
- name: LEDGERS
value: {{ .Values.ca.agent.ledgers | quote }}
......
......@@ -87,7 +87,8 @@ ocm:
basic:
user: "ocm-admin"
pass: ""
oob:
url: "https://issuer-dev.vereign.com"
# nats:
# server: "nats.ocm:4222"
# name: "ssi_issuer_stream"
......@@ -131,7 +132,9 @@ ocmtest:
publicKey: ""
basic:
user: "ocmtest-admin"
pass: ""
pass: ""
oob:
url: "https://holder-dev.vereign.com"
# nats:
......@@ -182,7 +185,9 @@ hin:
publicKey: ""
basic:
user: "ocmhin-admin"
pass: ""
pass: ""
oob:
url: "https://hin-dev.vereign.com"
ca:
agent:
......
......@@ -74,15 +74,25 @@ export class AgentService {
const response = new CreateInvitationResponseDto();
response.invitationUrl = outOfBoundRecord.outOfBandInvitation.toUrl({
let longUrl = outOfBoundRecord.outOfBandInvitation.toUrl({
domain: this.askar.agentConfig.agentPeerAddress,
});
if (this.askar.agentConfig.agentOobUrl) {
longUrl = longUrl.replace(
this.askar.agentConfig.agentPeerAddress,
this.askar.agentConfig.agentOobUrl,
);
}
//TODO: should we replace the short url with agentOobUrl if we do this we should have a redirect in ingress
response.shortInvitationUrl = `${this.askar.agentConfig.agentPeerAddress}/invitations/${outOfBoundRecord.outOfBandInvitation.id}`;
response.outOfBandId = outOfBoundRecord.id;
response.createdAt = outOfBoundRecord.createdAt;
response.updatedAt = outOfBoundRecord.updatedAt;
response.role = outOfBoundRecord.role;
response.state = outOfBoundRecord.state;
response.invitationUrl = longUrl;
return response;
};
......
......@@ -37,5 +37,6 @@ export const agentConfig = registerAs(
agentAuthJwtPublicKey: process.env["AUTH_JWT_PUBLIC_KEY"]!,
logLevel: parseInt(process.env["LOG_LEVEL"]!) ?? LogLevel.error,
agentWebHook: process.env["AGENT_WEBHOOK_URL"]!,
agentOobUrl: process.env["AGENT_OOB_URL"] || undefined,
}),
);
......@@ -27,4 +27,5 @@ export interface IConfAgent {
logLevel: number;
agentWebHook: string;
agentOobUrl: string | undefined;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment