From a6ac10c7d93e9f0f1b3713a6c20fe06245cd4b2c Mon Sep 17 00:00:00 2001 From: michaeltout Date: Mon, 26 Sep 2022 00:18:36 +0200 Subject: [PATCH 1/6] Separate out oidc related protocol with Verus protocol for deeplink requests and responses --- dist/vdxf/classes/Challenge.d.ts | 135 ++++++--------- dist/vdxf/classes/Challenge.js | 72 +++++--- dist/vdxf/classes/Decision.d.ts | 96 +++-------- dist/vdxf/classes/Decision.js | 60 ++++--- dist/vdxf/classes/Request.d.ts | 54 ++---- dist/vdxf/classes/Response.d.ts | 66 ++------ dist/vdxf/classes/index.d.ts | 6 +- dist/vdxf/classes/index.js | 14 +- dist/vdxf/classes/oidc/OidcChallenge.d.ts | 92 ++++++++++ dist/vdxf/classes/oidc/OidcChallenge.js | 41 +++++ dist/vdxf/classes/oidc/OidcClient.d.ts | 73 ++++++++ dist/vdxf/classes/oidc/OidcClient.js | 55 ++++++ dist/vdxf/classes/oidc/OidcDecision.d.ts | 105 ++++++++++++ dist/vdxf/classes/oidc/OidcDecision.js | 40 +++++ dist/vdxf/classes/oidc/OidcRequest.d.ts | 70 ++++++++ dist/vdxf/classes/oidc/OidcRequest.js | 28 ++++ dist/vdxf/keys.d.ts | 5 +- dist/vdxf/keys.js | 34 +++- src/vdxf/classes/Challenge.ts | 158 +++++++++++------- src/vdxf/classes/Decision.ts | 94 ++++++----- src/vdxf/classes/index.ts | 9 +- src/vdxf/classes/oidc/OidcChallenge.ts | 83 +++++++++ .../classes/{Client.ts => oidc/OidcClient.ts} | 10 +- src/vdxf/classes/oidc/OidcDecision.ts | 67 ++++++++ src/vdxf/classes/oidc/OidcRequest.ts | 40 +++++ src/vdxf/index.ts | 2 +- src/vdxf/keys.ts | 35 +++- 27 files changed, 1128 insertions(+), 416 deletions(-) create mode 100644 dist/vdxf/classes/oidc/OidcChallenge.d.ts create mode 100644 dist/vdxf/classes/oidc/OidcChallenge.js create mode 100644 dist/vdxf/classes/oidc/OidcClient.d.ts create mode 100644 dist/vdxf/classes/oidc/OidcClient.js create mode 100644 dist/vdxf/classes/oidc/OidcDecision.d.ts create mode 100644 dist/vdxf/classes/oidc/OidcDecision.js create mode 100644 dist/vdxf/classes/oidc/OidcRequest.d.ts create mode 100644 dist/vdxf/classes/oidc/OidcRequest.js create mode 100644 src/vdxf/classes/oidc/OidcChallenge.ts rename src/vdxf/classes/{Client.ts => oidc/OidcClient.ts} (92%) create mode 100644 src/vdxf/classes/oidc/OidcDecision.ts create mode 100644 src/vdxf/classes/oidc/OidcRequest.ts diff --git a/dist/vdxf/classes/Challenge.d.ts b/dist/vdxf/classes/Challenge.d.ts index d6ed6d31..1ecbf348 100644 --- a/dist/vdxf/classes/Challenge.d.ts +++ b/dist/vdxf/classes/Challenge.d.ts @@ -1,92 +1,67 @@ -import { Client, ClientInterface } from "./Client"; import { VDXFObject } from "../"; +export declare class RedirectUri extends VDXFObject { + uri: string; + constructor(uri: string, vdxfkey: string); + stringable(): { + uri: string; + vdxfkey: string; + }; +} +export declare class Subject extends VDXFObject { + data: string; + constructor(data: string, vdxfkey: string); + stringable(): { + data: string; + vdxfkey: string; + }; +} export interface ChallengeInterface { - uuid: string; - requested_scope?: Array | null; - requested_access_token_audience?: Array | null; - skip?: boolean; - subject?: string; - oidc_context?: { - acr_values: Array; - display: string; - id_token_hint_claims: { - [key: string]: any; - }; - login_hint: string; - ui_locales: Array; - } | {}; - request_url?: string; - login_challenge?: string; - login_session_id?: string; - acr?: string; + challenge_id: string; + requested_access?: Array | null; + requested_access_audience?: Array | null; + subject?: Array; + alt_auth_factors?: Array | null; session_id?: string; - client: ClientInterface; + attestations?: null; + redirect_uris?: Array; + created_at?: string; + salt: string; + context: { + [key: string]: any; + }; } -export declare class Challenge extends VDXFObject { - uuid: string; - client: Client; - requested_scope?: Array | null; - requested_access_token_audience?: Array | null; - skip?: boolean; - subject?: string; - oidc_context?: { - acr_values: Array; - display: string; - id_token_hint_claims: { - [key: string]: any; - }; - login_hint: string; - ui_locales: Array; - } | {}; - request_url?: string; - login_challenge?: string; - login_session_id?: string; - acr?: string; +export declare class Challenge extends VDXFObject implements ChallengeInterface { + challenge_id: string; + requested_access?: Array | null; + requested_access_audience?: Array | null; + subject?: Array; + alt_auth_factors?: Array | null; session_id?: string; + attestations?: null; + redirect_uris?: Array; + created_at?: string; + salt: string; + context: { + [key: string]: any; + }; constructor(challenge: ChallengeInterface); stringable(): { vdxfkey: string; - uuid: string; - client: { + challenge_id: string; + requested_access: string[]; + requested_access_audience: string[]; + subject: Subject[]; + alt_auth_factors: string[]; + session_id: string; + attestations: null; + redirect_uris: { + uri: string; vdxfkey: string; - client_id: string; - name: string; - redirect_uris: import("./Client").RedirectUri[]; - grant_types: string[]; - response_types: string[]; - scope: string; - audience: string[]; - owner: string; - policy_uri: string; - allowed_cors_origins: string[]; - tos_uri: string; - client_uri: string; - logo_uri: string; - contacts: string[]; - client_secret_expires_at: number; - subject_type: string; - token_endpoint_auth_method: string; - userinfo_signed_response_alg: string; - created_at: string; - updated_at: string; - }; - requested_scope: string[]; - requested_access_token_audience: string[]; - skip: boolean; - subject: string; - oidc_context: {} | { - acr_values: string[]; - display: string; - id_token_hint_claims: { - [key: string]: any; - }; - login_hint: string; - ui_locales: string[]; + }[]; + created_at: string; + salt: string; + context: { + [key: string]: any; }; - request_url: string; - login_challenge: string; - login_session_id: string; - acr: string; - session_id: string; }; } diff --git a/dist/vdxf/classes/Challenge.js b/dist/vdxf/classes/Challenge.js index 5819a462..910da35f 100644 --- a/dist/vdxf/classes/Challenge.js +++ b/dist/vdxf/classes/Challenge.js @@ -1,40 +1,66 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.Challenge = void 0; -const Client_1 = require("./Client"); +exports.Challenge = exports.Subject = exports.RedirectUri = void 0; const __1 = require("../"); +class RedirectUri extends __1.VDXFObject { + constructor(uri, vdxfkey) { + super(vdxfkey); + this.uri = uri; + } + stringable() { + return { + uri: this.uri, + vdxfkey: this.vdxfkey + }; + } +} +exports.RedirectUri = RedirectUri; +class Subject extends __1.VDXFObject { + constructor(data, vdxfkey) { + super(vdxfkey); + this.data = data; + } + stringable() { + return { + data: this.data, + vdxfkey: this.vdxfkey + }; + } +} +exports.Subject = Subject; class Challenge extends __1.VDXFObject { constructor(challenge) { super(__1.LOGIN_CONSENT_CHALLENGE_VDXF_KEY.vdxfid); - this.uuid = ""; - this.uuid = challenge.uuid; - this.requested_scope = challenge.requested_scope; - this.requested_access_token_audience = challenge.requested_access_token_audience; - this.skip = challenge.skip; + this.challenge_id = challenge.challenge_id; + this.requested_access = challenge.requested_access; + this.requested_access_audience = challenge.requested_access_audience; this.subject = challenge.subject; - this.oidc_context = challenge.oidc_context; - this.request_url = challenge.request_url; - this.login_challenge = challenge.login_challenge; - this.login_session_id = challenge.login_session_id; - this.acr = challenge.acr; + this.alt_auth_factors = challenge.alt_auth_factors; this.session_id = challenge.session_id; - this.client = new Client_1.Client(challenge.client); + this.attestations = challenge.attestations; + this.redirect_uris = challenge.redirect_uris + ? challenge.redirect_uris.map((x) => new RedirectUri(x.uri, x.vdxfkey)) + : challenge.redirect_uris; + this.created_at = challenge.created_at; + this.salt = challenge.salt; + this.context = challenge.context; } stringable() { return { vdxfkey: this.vdxfkey, - uuid: this.uuid, - client: this.client.stringable(), - requested_scope: this.requested_scope, - requested_access_token_audience: this.requested_access_token_audience, - skip: this.skip, + challenge_id: this.challenge_id, + requested_access: this.requested_access, + requested_access_audience: this.requested_access_audience, subject: this.subject, - oidc_context: this.oidc_context, - request_url: this.request_url, - login_challenge: this.login_challenge, - login_session_id: this.login_session_id, - acr: this.acr, + alt_auth_factors: this.alt_auth_factors, session_id: this.session_id, + attestations: this.attestations, + redirect_uris: this.redirect_uris + ? this.redirect_uris.map((x) => x.stringable()) + : this.redirect_uris, + created_at: this.created_at, + salt: this.salt, + context: this.context }; } } diff --git a/dist/vdxf/classes/Decision.d.ts b/dist/vdxf/classes/Decision.d.ts index 679c68c9..1fa439fc 100644 --- a/dist/vdxf/classes/Decision.d.ts +++ b/dist/vdxf/classes/Decision.d.ts @@ -1,52 +1,30 @@ -import { VDXFObject } from "../"; +import { VDXFObject } from ".."; +import { OidcDecision } from "./oidc/OidcDecision"; import { Request, RequestInterface } from "./Request"; export interface DecisionInterface { - subject?: string; - remember?: boolean; - remember_for?: number; - acr?: string; + decision_id: string; + request: RequestInterface; + created_at?: string; context?: { [key: string]: any; }; - force_subject_identifier?: string; - error?: string; - error_description?: string; - error_hint?: string; - error_debug?: string; - status_code?: number; - request: RequestInterface; } export declare class Decision extends VDXFObject { - subject?: string; - remember?: boolean; - remember_for?: number; - acr?: string; + decision_id: string; context?: { [key: string]: any; }; - force_subject_identifier?: string; - error?: string; - error_description?: string; - error_hint?: string; - error_debug?: string; - status_code?: number; request: Request; + created_at: string; constructor(decision: DecisionInterface); + toOidcDecision(): OidcDecision; stringable(): { vdxfkey: string; - subject: string; - remember: boolean; - remember_for: number; - acr: string; + decision_id: string; context: { [key: string]: any; }; - force_subject_identifier: string; - error: string; - error_description: string; - error_hint: string; - error_debug: string; - status_code: number; + created_at: string; request: { vdxfkey: string; chain_id: string; @@ -57,48 +35,22 @@ export declare class Decision extends VDXFObject { }; challenge: { vdxfkey: string; - uuid: string; - client: { + challenge_id: string; + requested_access: string[]; + requested_access_audience: string[]; + subject: import("./Challenge").Subject[]; + alt_auth_factors: string[]; + session_id: string; + attestations: null; + redirect_uris: { + uri: string; vdxfkey: string; - client_id: string; - name: string; - redirect_uris: import("./Client").RedirectUri[]; - grant_types: string[]; - response_types: string[]; - scope: string; - audience: string[]; - owner: string; - policy_uri: string; - allowed_cors_origins: string[]; - tos_uri: string; - client_uri: string; - logo_uri: string; - contacts: string[]; - client_secret_expires_at: number; - subject_type: string; - token_endpoint_auth_method: string; - userinfo_signed_response_alg: string; - created_at: string; - updated_at: string; + }[]; + created_at: string; + salt: string; + context: { + [key: string]: any; }; - requested_scope: string[]; - requested_access_token_audience: string[]; - skip: boolean; - subject: string; - oidc_context: {} | { - acr_values: string[]; - display: string; - id_token_hint_claims: { - [key: string]: any; - }; - login_hint: string; - ui_locales: string[]; - }; - request_url: string; - login_challenge: string; - login_session_id: string; - acr: string; - session_id: string; }; }; }; diff --git a/dist/vdxf/classes/Decision.js b/dist/vdxf/classes/Decision.js index 0efc5bee..22d4d468 100644 --- a/dist/vdxf/classes/Decision.js +++ b/dist/vdxf/classes/Decision.js @@ -1,38 +1,54 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Decision = void 0; -const __1 = require("../"); +const __1 = require(".."); +const OidcChallenge_1 = require("./oidc/OidcChallenge"); +const OidcClient_1 = require("./oidc/OidcClient"); +const OidcDecision_1 = require("./oidc/OidcDecision"); +const OidcRequest_1 = require("./oidc/OidcRequest"); const Request_1 = require("./Request"); class Decision extends __1.VDXFObject { constructor(decision) { super(__1.LOGIN_CONSENT_DECISION_VDXF_KEY.vdxfid); - this.subject = decision.subject; - this.remember = decision.remember; - this.remember_for = decision.remember_for; - this.acr = decision.acr; - this.context = decision.context; - this.force_subject_identifier = decision.force_subject_identifier; - this.error = decision.error; - this.error_description = decision.error_description; - this.error_hint = decision.error_hint; - this.error_debug = decision.error_debug; - this.status_code = decision.status_code; + this.decision_id = decision.decision_id; this.request = new Request_1.Request(decision.request); + this.context = decision.context; + this.created_at = decision.created_at; + } + toOidcDecision() { + return new OidcDecision_1.OidcDecision({ + subject: this.request.challenge.subject ? JSON.stringify(this.request.challenge.subject) : undefined, + context: this.context, + request: new OidcRequest_1.OidcRequest({ + chain_id: this.request.chain_id, + signing_id: this.request.signing_id, + signature: this.request.signature, + challenge: new OidcChallenge_1.OidcChallenge({ + uuid: this.request.challenge.challenge_id, + requested_scope: this.request.challenge.requested_access, + requested_access_token_audience: this.request.challenge.requested_access_audience, + subject: this.request.challenge.subject ? JSON.stringify(this.request.challenge.subject) : undefined, + session_id: this.request.challenge.session_id, + client: new OidcClient_1.OidcClient({ + client_id: this.request.challenge.challenge_id, + redirect_uris: this.request.challenge.redirect_uris ? this.request.challenge.redirect_uris.map(x => { + return { + type: x.vdxfkey, + uri: x.uri + }; + }) : undefined, + created_at: this.request.challenge.created_at + }) + }) + }) + }); } stringable() { return { vdxfkey: this.vdxfkey, - subject: this.subject, - remember: this.remember, - remember_for: this.remember_for, - acr: this.acr, + decision_id: this.decision_id, context: this.context, - force_subject_identifier: this.force_subject_identifier, - error: this.error, - error_description: this.error_description, - error_hint: this.error_hint, - error_debug: this.error_debug, - status_code: this.status_code, + created_at: this.created_at, request: this.request.stringable(), }; } diff --git a/dist/vdxf/classes/Request.d.ts b/dist/vdxf/classes/Request.d.ts index a7fb1739..d131252d 100644 --- a/dist/vdxf/classes/Request.d.ts +++ b/dist/vdxf/classes/Request.d.ts @@ -23,48 +23,22 @@ export declare class Request extends VDXFObject { }; challenge: { vdxfkey: string; - uuid: string; - client: { + challenge_id: string; + requested_access: string[]; + requested_access_audience: string[]; + subject: import("./Challenge").Subject[]; + alt_auth_factors: string[]; + session_id: string; + attestations: null; + redirect_uris: { + uri: string; vdxfkey: string; - client_id: string; - name: string; - redirect_uris: import("./Client").RedirectUri[]; - grant_types: string[]; - response_types: string[]; - scope: string; - audience: string[]; - owner: string; - policy_uri: string; - allowed_cors_origins: string[]; - tos_uri: string; - client_uri: string; - logo_uri: string; - contacts: string[]; - client_secret_expires_at: number; - subject_type: string; - token_endpoint_auth_method: string; - userinfo_signed_response_alg: string; - created_at: string; - updated_at: string; - }; - requested_scope: string[]; - requested_access_token_audience: string[]; - skip: boolean; - subject: string; - oidc_context: {} | { - acr_values: string[]; - display: string; - id_token_hint_claims: { - [key: string]: any; - }; - login_hint: string; - ui_locales: string[]; + }[]; + created_at: string; + salt: string; + context: { + [key: string]: any; }; - request_url: string; - login_challenge: string; - login_session_id: string; - acr: string; - session_id: string; }; }; } diff --git a/dist/vdxf/classes/Response.d.ts b/dist/vdxf/classes/Response.d.ts index ff12bafe..1f92a732 100644 --- a/dist/vdxf/classes/Response.d.ts +++ b/dist/vdxf/classes/Response.d.ts @@ -20,19 +20,11 @@ export declare class Response extends VDXFObject { signing_id: string; decision: { vdxfkey: string; - subject: string; - remember: boolean; - remember_for: number; - acr: string; + decision_id: string; context: { [key: string]: any; }; - force_subject_identifier: string; - error: string; - error_description: string; - error_hint: string; - error_debug: string; - status_code: number; + created_at: string; request: { vdxfkey: string; chain_id: string; @@ -43,48 +35,22 @@ export declare class Response extends VDXFObject { }; challenge: { vdxfkey: string; - uuid: string; - client: { + challenge_id: string; + requested_access: string[]; + requested_access_audience: string[]; + subject: import("./Challenge").Subject[]; + alt_auth_factors: string[]; + session_id: string; + attestations: null; + redirect_uris: { + uri: string; vdxfkey: string; - client_id: string; - name: string; - redirect_uris: import("./Client").RedirectUri[]; - grant_types: string[]; - response_types: string[]; - scope: string; - audience: string[]; - owner: string; - policy_uri: string; - allowed_cors_origins: string[]; - tos_uri: string; - client_uri: string; - logo_uri: string; - contacts: string[]; - client_secret_expires_at: number; - subject_type: string; - token_endpoint_auth_method: string; - userinfo_signed_response_alg: string; - created_at: string; - updated_at: string; - }; - requested_scope: string[]; - requested_access_token_audience: string[]; - skip: boolean; - subject: string; - oidc_context: {} | { - acr_values: string[]; - display: string; - id_token_hint_claims: { - [key: string]: any; - }; - login_hint: string; - ui_locales: string[]; + }[]; + created_at: string; + salt: string; + context: { + [key: string]: any; }; - request_url: string; - login_challenge: string; - login_session_id: string; - acr: string; - session_id: string; }; }; }; diff --git a/dist/vdxf/classes/index.d.ts b/dist/vdxf/classes/index.d.ts index ff85273a..ff4f15d2 100644 --- a/dist/vdxf/classes/index.d.ts +++ b/dist/vdxf/classes/index.d.ts @@ -1,5 +1,7 @@ -export { Decision as LoginConsentDecision } from './Decision'; export { Challenge as LoginConsentChallenge } from './Challenge'; -export { Client as LoginConsentClient } from './Client'; +export { Decision as LoginConsentDecision } from './Decision'; export { Request as LoginConsentRequest } from './Request'; export { Response as LoginConsentResponse } from './Response'; +export { OidcClient as OidcLoginConsentClient } from './oidc/OidcClient'; +export { OidcChallenge as OidcLoginConsentChallenge } from './oidc/OidcChallenge'; +export { OidcDecision as OidcLoginConsentDecision } from './oidc/OidcDecision'; diff --git a/dist/vdxf/classes/index.js b/dist/vdxf/classes/index.js index 1a47cde6..ab368e2c 100644 --- a/dist/vdxf/classes/index.js +++ b/dist/vdxf/classes/index.js @@ -1,13 +1,17 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.LoginConsentResponse = exports.LoginConsentRequest = exports.LoginConsentClient = exports.LoginConsentChallenge = exports.LoginConsentDecision = void 0; -var Decision_1 = require("./Decision"); -Object.defineProperty(exports, "LoginConsentDecision", { enumerable: true, get: function () { return Decision_1.Decision; } }); +exports.OidcLoginConsentDecision = exports.OidcLoginConsentChallenge = exports.OidcLoginConsentClient = exports.LoginConsentResponse = exports.LoginConsentRequest = exports.LoginConsentDecision = exports.LoginConsentChallenge = void 0; var Challenge_1 = require("./Challenge"); Object.defineProperty(exports, "LoginConsentChallenge", { enumerable: true, get: function () { return Challenge_1.Challenge; } }); -var Client_1 = require("./Client"); -Object.defineProperty(exports, "LoginConsentClient", { enumerable: true, get: function () { return Client_1.Client; } }); +var Decision_1 = require("./Decision"); +Object.defineProperty(exports, "LoginConsentDecision", { enumerable: true, get: function () { return Decision_1.Decision; } }); var Request_1 = require("./Request"); Object.defineProperty(exports, "LoginConsentRequest", { enumerable: true, get: function () { return Request_1.Request; } }); var Response_1 = require("./Response"); Object.defineProperty(exports, "LoginConsentResponse", { enumerable: true, get: function () { return Response_1.Response; } }); +var OidcClient_1 = require("./oidc/OidcClient"); +Object.defineProperty(exports, "OidcLoginConsentClient", { enumerable: true, get: function () { return OidcClient_1.OidcClient; } }); +var OidcChallenge_1 = require("./oidc/OidcChallenge"); +Object.defineProperty(exports, "OidcLoginConsentChallenge", { enumerable: true, get: function () { return OidcChallenge_1.OidcChallenge; } }); +var OidcDecision_1 = require("./oidc/OidcDecision"); +Object.defineProperty(exports, "OidcLoginConsentDecision", { enumerable: true, get: function () { return OidcDecision_1.OidcDecision; } }); diff --git a/dist/vdxf/classes/oidc/OidcChallenge.d.ts b/dist/vdxf/classes/oidc/OidcChallenge.d.ts new file mode 100644 index 00000000..092896a4 --- /dev/null +++ b/dist/vdxf/classes/oidc/OidcChallenge.d.ts @@ -0,0 +1,92 @@ +import { OidcClient, OidcClientInterface } from "./OidcClient"; +import { VDXFObject } from "../.."; +export interface OidcChallengeInterface { + uuid: string; + requested_scope?: Array | null; + requested_access_token_audience?: Array | null; + skip?: boolean; + subject?: string; + oidc_context?: { + acr_values: Array; + display: string; + id_token_hint_claims: { + [key: string]: any; + }; + login_hint: string; + ui_locales: Array; + } | {}; + request_url?: string; + login_challenge?: string; + login_session_id?: string; + acr?: string; + session_id?: string; + client: OidcClientInterface; +} +export declare class OidcChallenge extends VDXFObject { + uuid: string; + client: OidcClient; + requested_scope?: Array | null; + requested_access_token_audience?: Array | null; + skip?: boolean; + subject?: string; + oidc_context?: { + acr_values: Array; + display: string; + id_token_hint_claims: { + [key: string]: any; + }; + login_hint: string; + ui_locales: Array; + } | {}; + request_url?: string; + login_challenge?: string; + login_session_id?: string; + acr?: string; + session_id?: string; + constructor(challenge: OidcChallengeInterface); + stringable(): { + vdxfkey: string; + uuid: string; + client: { + vdxfkey: string; + client_id: string; + name: string; + redirect_uris: import("./OidcClient").RedirectUri[]; + grant_types: string[]; + response_types: string[]; + scope: string; + audience: string[]; + owner: string; + policy_uri: string; + allowed_cors_origins: string[]; + tos_uri: string; + client_uri: string; + logo_uri: string; + contacts: string[]; + client_secret_expires_at: number; + subject_type: string; + token_endpoint_auth_method: string; + userinfo_signed_response_alg: string; + created_at: string; + updated_at: string; + }; + requested_scope: string[]; + requested_access_token_audience: string[]; + skip: boolean; + subject: string; + oidc_context: {} | { + acr_values: string[]; + display: string; + id_token_hint_claims: { + [key: string]: any; + }; + login_hint: string; + ui_locales: string[]; + }; + request_url: string; + login_challenge: string; + login_session_id: string; + acr: string; + session_id: string; + }; +} diff --git a/dist/vdxf/classes/oidc/OidcChallenge.js b/dist/vdxf/classes/oidc/OidcChallenge.js new file mode 100644 index 00000000..5e4dcff6 --- /dev/null +++ b/dist/vdxf/classes/oidc/OidcChallenge.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OidcChallenge = void 0; +const OidcClient_1 = require("./OidcClient"); +const __1 = require("../.."); +class OidcChallenge extends __1.VDXFObject { + constructor(challenge) { + super(__1.LOGIN_CONSENT_OIDC_CHALLENGE_VDXF_KEY.vdxfid); + this.uuid = ""; + this.uuid = challenge.uuid; + this.requested_scope = challenge.requested_scope; + this.requested_access_token_audience = challenge.requested_access_token_audience; + this.skip = challenge.skip; + this.subject = challenge.subject; + this.oidc_context = challenge.oidc_context; + this.request_url = challenge.request_url; + this.login_challenge = challenge.login_challenge; + this.login_session_id = challenge.login_session_id; + this.acr = challenge.acr; + this.session_id = challenge.session_id; + this.client = new OidcClient_1.OidcClient(challenge.client); + } + stringable() { + return { + vdxfkey: this.vdxfkey, + uuid: this.uuid, + client: this.client.stringable(), + requested_scope: this.requested_scope, + requested_access_token_audience: this.requested_access_token_audience, + skip: this.skip, + subject: this.subject, + oidc_context: this.oidc_context, + request_url: this.request_url, + login_challenge: this.login_challenge, + login_session_id: this.login_session_id, + acr: this.acr, + session_id: this.session_id, + }; + } +} +exports.OidcChallenge = OidcChallenge; diff --git a/dist/vdxf/classes/oidc/OidcClient.d.ts b/dist/vdxf/classes/oidc/OidcClient.d.ts new file mode 100644 index 00000000..7e92633e --- /dev/null +++ b/dist/vdxf/classes/oidc/OidcClient.d.ts @@ -0,0 +1,73 @@ +import { VDXFObject } from "../../"; +export interface RedirectUri { + type: string; + uri: string; +} +export interface OidcClientInterface { + client_id: string; + name?: string; + redirect_uris?: Array; + grant_types?: Array; + response_types?: Array; + scope?: string; + audience?: Array | null; + owner?: string; + policy_uri?: string; + allowed_cors_origins?: Array | null; + tos_uri?: string; + client_uri?: string; + logo_uri?: string; + contacts?: Array | null; + client_secret_expires_at?: number; + subject_type?: string; + token_endpoint_auth_method?: string; + userinfo_signed_response_alg?: string; + created_at: string; + updated_at?: string; +} +export declare class OidcClient extends VDXFObject { + client_id: string; + name?: string; + redirect_uris?: Array; + grant_types?: Array; + response_types?: Array; + scope?: string; + audience?: Array | null; + owner?: string; + policy_uri?: string; + allowed_cors_origins?: Array | null; + tos_uri?: string; + client_uri?: string; + logo_uri?: string; + contacts?: Array | null; + client_secret_expires_at?: number; + subject_type?: string; + token_endpoint_auth_method?: string; + userinfo_signed_response_alg?: string; + created_at: string; + updated_at?: string; + constructor(client: OidcClientInterface); + stringable(): { + vdxfkey: string; + client_id: string; + name: string; + redirect_uris: RedirectUri[]; + grant_types: string[]; + response_types: string[]; + scope: string; + audience: string[]; + owner: string; + policy_uri: string; + allowed_cors_origins: string[]; + tos_uri: string; + client_uri: string; + logo_uri: string; + contacts: string[]; + client_secret_expires_at: number; + subject_type: string; + token_endpoint_auth_method: string; + userinfo_signed_response_alg: string; + created_at: string; + updated_at: string; + }; +} diff --git a/dist/vdxf/classes/oidc/OidcClient.js b/dist/vdxf/classes/oidc/OidcClient.js new file mode 100644 index 00000000..e376df8f --- /dev/null +++ b/dist/vdxf/classes/oidc/OidcClient.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OidcClient = void 0; +const __1 = require("../../"); +class OidcClient extends __1.VDXFObject { + constructor(client) { + super(__1.LOGIN_CONSENT_OIDC_CLIENT_VDXF_KEY.vdxfid); + this.client_id = client.client_id; + this.name = client.name; + this.redirect_uris = client.redirect_uris; + this.grant_types = client.grant_types; + this.response_types = client.response_types; + this.scope = client.scope; + this.audience = client.audience; + this.owner = client.owner; + this.policy_uri = client.policy_uri; + this.allowed_cors_origins = client.allowed_cors_origins; + this.tos_uri = client.tos_uri; + this.client_uri = client.client_uri; + this.logo_uri = client.logo_uri; + this.contacts = client.contacts; + this.client_secret_expires_at = client.client_secret_expires_at; + this.subject_type = client.subject_type; + this.token_endpoint_auth_method = client.token_endpoint_auth_method; + this.userinfo_signed_response_alg = client.userinfo_signed_response_alg; + this.created_at = client.created_at; + this.updated_at = client.updated_at; + } + stringable() { + return { + vdxfkey: this.vdxfkey, + client_id: this.client_id, + name: this.name, + redirect_uris: this.redirect_uris, + grant_types: this.grant_types, + response_types: this.response_types, + scope: this.scope, + audience: this.audience, + owner: this.owner, + policy_uri: this.policy_uri, + allowed_cors_origins: this.allowed_cors_origins, + tos_uri: this.tos_uri, + client_uri: this.client_uri, + logo_uri: this.logo_uri, + contacts: this.contacts, + client_secret_expires_at: this.client_secret_expires_at, + subject_type: this.subject_type, + token_endpoint_auth_method: this.token_endpoint_auth_method, + userinfo_signed_response_alg: this.userinfo_signed_response_alg, + created_at: this.created_at, + updated_at: this.updated_at, + }; + } +} +exports.OidcClient = OidcClient; diff --git a/dist/vdxf/classes/oidc/OidcDecision.d.ts b/dist/vdxf/classes/oidc/OidcDecision.d.ts new file mode 100644 index 00000000..716c366d --- /dev/null +++ b/dist/vdxf/classes/oidc/OidcDecision.d.ts @@ -0,0 +1,105 @@ +import { VDXFObject } from "../../"; +import { OidcRequest, OidcRequestInterface } from "./OidcRequest"; +export interface OidcDecisionInterface { + subject?: string; + remember?: boolean; + remember_for?: number; + acr?: string; + context?: { + [key: string]: any; + }; + force_subject_identifier?: string; + error?: string; + error_description?: string; + error_hint?: string; + error_debug?: string; + status_code?: number; + request: OidcRequestInterface; +} +export declare class OidcDecision extends VDXFObject { + subject?: string; + remember?: boolean; + remember_for?: number; + acr?: string; + context?: { + [key: string]: any; + }; + force_subject_identifier?: string; + error?: string; + error_description?: string; + error_hint?: string; + error_debug?: string; + status_code?: number; + request: OidcRequest; + constructor(decision: OidcDecisionInterface); + stringable(): { + vdxfkey: string; + subject: string; + remember: boolean; + remember_for: number; + acr: string; + context: { + [key: string]: any; + }; + force_subject_identifier: string; + error: string; + error_description: string; + error_hint: string; + error_debug: string; + status_code: number; + request: { + vdxfkey: string; + chain_id: string; + signing_id: string; + signature: { + vdxfkey: string; + signature: string; + }; + challenge: { + vdxfkey: string; + uuid: string; + client: { + vdxfkey: string; + client_id: string; + name: string; + redirect_uris: import("./OidcClient").RedirectUri[]; + grant_types: string[]; + response_types: string[]; + scope: string; + audience: string[]; + owner: string; + policy_uri: string; + allowed_cors_origins: string[]; + tos_uri: string; + client_uri: string; + logo_uri: string; + contacts: string[]; + client_secret_expires_at: number; + subject_type: string; + token_endpoint_auth_method: string; + userinfo_signed_response_alg: string; + created_at: string; + updated_at: string; + }; + requested_scope: string[]; + requested_access_token_audience: string[]; + skip: boolean; + subject: string; + oidc_context: {} | { + acr_values: string[]; + display: string; + id_token_hint_claims: { + [key: string]: any; + }; + login_hint: string; + ui_locales: string[]; + }; + request_url: string; + login_challenge: string; + login_session_id: string; + acr: string; + session_id: string; + }; + }; + }; +} diff --git a/dist/vdxf/classes/oidc/OidcDecision.js b/dist/vdxf/classes/oidc/OidcDecision.js new file mode 100644 index 00000000..a5b668cb --- /dev/null +++ b/dist/vdxf/classes/oidc/OidcDecision.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OidcDecision = void 0; +const __1 = require("../../"); +const OidcRequest_1 = require("./OidcRequest"); +class OidcDecision extends __1.VDXFObject { + constructor(decision) { + super(__1.LOGIN_CONSENT_OIDC_DECISION_VDXF_KEY.vdxfid); + this.subject = decision.subject; + this.remember = decision.remember; + this.remember_for = decision.remember_for; + this.acr = decision.acr; + this.context = decision.context; + this.force_subject_identifier = decision.force_subject_identifier; + this.error = decision.error; + this.error_description = decision.error_description; + this.error_hint = decision.error_hint; + this.error_debug = decision.error_debug; + this.status_code = decision.status_code; + this.request = new OidcRequest_1.OidcRequest(decision.request); + } + stringable() { + return { + vdxfkey: this.vdxfkey, + subject: this.subject, + remember: this.remember, + remember_for: this.remember_for, + acr: this.acr, + context: this.context, + force_subject_identifier: this.force_subject_identifier, + error: this.error, + error_description: this.error_description, + error_hint: this.error_hint, + error_debug: this.error_debug, + status_code: this.status_code, + request: this.request.stringable(), + }; + } +} +exports.OidcDecision = OidcDecision; diff --git a/dist/vdxf/classes/oidc/OidcRequest.d.ts b/dist/vdxf/classes/oidc/OidcRequest.d.ts new file mode 100644 index 00000000..1c785586 --- /dev/null +++ b/dist/vdxf/classes/oidc/OidcRequest.d.ts @@ -0,0 +1,70 @@ +import { VDXFObject, VerusIDSignature, VerusIDSignatureInterface } from "../.."; +import { OidcChallenge, OidcChallengeInterface } from "./OidcChallenge"; +export interface OidcRequestInterface { + chain_id: string; + signing_id: string; + signature: VerusIDSignatureInterface; + challenge: OidcChallengeInterface; +} +export declare class OidcRequest extends VDXFObject { + chain_id: string; + signing_id: string; + signature: VerusIDSignature; + challenge: OidcChallenge; + constructor(request: OidcRequestInterface); + getSignedData(): string; + stringable(): { + vdxfkey: string; + chain_id: string; + signing_id: string; + signature: { + vdxfkey: string; + signature: string; + }; + challenge: { + vdxfkey: string; + uuid: string; + client: { + vdxfkey: string; + client_id: string; + name: string; + redirect_uris: import("./OidcClient").RedirectUri[]; + grant_types: string[]; + response_types: string[]; + scope: string; + audience: string[]; + owner: string; + policy_uri: string; + allowed_cors_origins: string[]; + tos_uri: string; + client_uri: string; + logo_uri: string; + contacts: string[]; + client_secret_expires_at: number; + subject_type: string; + token_endpoint_auth_method: string; + userinfo_signed_response_alg: string; + created_at: string; + updated_at: string; + }; + requested_scope: string[]; + requested_access_token_audience: string[]; + skip: boolean; + subject: string; + oidc_context: {} | { + acr_values: string[]; + display: string; + id_token_hint_claims: { + [key: string]: any; + }; + login_hint: string; + ui_locales: string[]; + }; + request_url: string; + login_challenge: string; + login_session_id: string; + acr: string; + session_id: string; + }; + }; +} diff --git a/dist/vdxf/classes/oidc/OidcRequest.js b/dist/vdxf/classes/oidc/OidcRequest.js new file mode 100644 index 00000000..d3902b9d --- /dev/null +++ b/dist/vdxf/classes/oidc/OidcRequest.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OidcRequest = void 0; +const __1 = require("../.."); +const keys_1 = require("../../keys"); +const OidcChallenge_1 = require("./OidcChallenge"); +class OidcRequest extends __1.VDXFObject { + constructor(request) { + super(__1.LOGIN_CONSENT_OIDC_REQUEST_VDXF_KEY.vdxfid); + this.chain_id = request.chain_id; + this.signing_id = request.signing_id; + this.signature = new __1.VerusIDSignature(request.signature, keys_1.LOGIN_CONSENT_REQUEST_SIG_VDXF_KEY); + this.challenge = new OidcChallenge_1.OidcChallenge(request.challenge); + } + getSignedData() { + return this.challenge.toString(); + } + stringable() { + return { + vdxfkey: this.vdxfkey, + chain_id: this.chain_id, + signing_id: this.signing_id, + signature: this.signature.stringable(), + challenge: this.challenge.stringable(), + }; + } +} +exports.OidcRequest = OidcRequest; diff --git a/dist/vdxf/keys.d.ts b/dist/vdxf/keys.d.ts index eef5c490..d17318ff 100644 --- a/dist/vdxf/keys.d.ts +++ b/dist/vdxf/keys.d.ts @@ -9,10 +9,13 @@ export interface VDXFKeyInterface { export declare const LOGIN_CONSENT_REQUEST_SIG_VDXF_KEY: VDXFKeyInterface; export declare const LOGIN_CONSENT_RESPONSE_SIG_VDXF_KEY: VDXFKeyInterface; export declare const LOGIN_CONSENT_REQUEST_VDXF_KEY: VDXFKeyInterface; +export declare const LOGIN_CONSENT_OIDC_REQUEST_VDXF_KEY: VDXFKeyInterface; export declare const LOGIN_CONSENT_RESPONSE_VDXF_KEY: VDXFKeyInterface; export declare const LOGIN_CONSENT_CHALLENGE_VDXF_KEY: VDXFKeyInterface; +export declare const LOGIN_CONSENT_OIDC_CHALLENGE_VDXF_KEY: VDXFKeyInterface; export declare const LOGIN_CONSENT_DECISION_VDXF_KEY: VDXFKeyInterface; -export declare const LOGIN_CONSENT_CLIENT_VDXF_KEY: VDXFKeyInterface; +export declare const LOGIN_CONSENT_OIDC_DECISION_VDXF_KEY: VDXFKeyInterface; +export declare const LOGIN_CONSENT_OIDC_CLIENT_VDXF_KEY: VDXFKeyInterface; export declare const WALLET_VDXF_KEY: VDXFKeyInterface; export declare const LOGIN_CONSENT_REDIRECT_VDXF_KEY: VDXFKeyInterface; export declare const LOGIN_CONSENT_WEBHOOK_VDXF_KEY: VDXFKeyInterface; diff --git a/dist/vdxf/keys.js b/dist/vdxf/keys.js index 364d07c7..e8d11e8f 100644 --- a/dist/vdxf/keys.js +++ b/dist/vdxf/keys.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.LOGIN_CONSENT_WEBHOOK_VDXF_KEY = exports.LOGIN_CONSENT_REDIRECT_VDXF_KEY = exports.WALLET_VDXF_KEY = exports.LOGIN_CONSENT_CLIENT_VDXF_KEY = exports.LOGIN_CONSENT_DECISION_VDXF_KEY = exports.LOGIN_CONSENT_CHALLENGE_VDXF_KEY = exports.LOGIN_CONSENT_RESPONSE_VDXF_KEY = exports.LOGIN_CONSENT_REQUEST_VDXF_KEY = exports.LOGIN_CONSENT_RESPONSE_SIG_VDXF_KEY = exports.LOGIN_CONSENT_REQUEST_SIG_VDXF_KEY = void 0; +exports.LOGIN_CONSENT_WEBHOOK_VDXF_KEY = exports.LOGIN_CONSENT_REDIRECT_VDXF_KEY = exports.WALLET_VDXF_KEY = exports.LOGIN_CONSENT_OIDC_CLIENT_VDXF_KEY = exports.LOGIN_CONSENT_OIDC_DECISION_VDXF_KEY = exports.LOGIN_CONSENT_DECISION_VDXF_KEY = exports.LOGIN_CONSENT_OIDC_CHALLENGE_VDXF_KEY = exports.LOGIN_CONSENT_CHALLENGE_VDXF_KEY = exports.LOGIN_CONSENT_RESPONSE_VDXF_KEY = exports.LOGIN_CONSENT_OIDC_REQUEST_VDXF_KEY = exports.LOGIN_CONSENT_REQUEST_VDXF_KEY = exports.LOGIN_CONSENT_RESPONSE_SIG_VDXF_KEY = exports.LOGIN_CONSENT_REQUEST_SIG_VDXF_KEY = void 0; exports.LOGIN_CONSENT_REQUEST_SIG_VDXF_KEY = { vdxfid: "iBFueEbXnSbohqiHNwwmz8Jb7LJtx2PGFu", hash160result: "28657ae163daff6bcb81034044699a4170235e55", @@ -25,6 +25,14 @@ exports.LOGIN_CONSENT_REQUEST_VDXF_KEY = { name: "vrsc::system.identity.authentication.loginconsent.request", }, }; +exports.LOGIN_CONSENT_OIDC_REQUEST_VDXF_KEY = { + "vdxfid": "i5XKaak5R68S1oW55dDDu7XEkRZpRTFts6", + "hash160result": "e19a485ca8bce6540ace5f40e415a4a7d29a7716", + "qualifiedname": { + "namespace": "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + "name": "vrsc::system.identity.authentication.loginconsent.oidcrequest" + } +}; exports.LOGIN_CONSENT_RESPONSE_VDXF_KEY = { vdxfid: "iJQaibDkoUxwGoE2YhZtVVZyhKxZs1G7uU", hash160result: "a77ba0f8c5a05fcc1ef0fa0ed93dab1501f7caa3", @@ -41,6 +49,14 @@ exports.LOGIN_CONSENT_CHALLENGE_VDXF_KEY = { name: "vrsc::system.identity.authentication.loginconsent.request.challenge", }, }; +exports.LOGIN_CONSENT_OIDC_CHALLENGE_VDXF_KEY = { + vdxfid: "iNiZWvtDmXSeYKNvu8GNZwCT3J9qFMrJwx", + hash160result: "6c52ec072c07c0b15d5b46f67e18547ce5f311d3", + qualifiedname: { + namespace: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + name: "vrsc::system.identity.authentication.loginconsent.request.oidcchallenge", + }, +}; exports.LOGIN_CONSENT_DECISION_VDXF_KEY = { vdxfid: "i7bCPAtS12cKwa7VevVZqgRusN4NXVCt5z", hash160result: "b870b7693cc7de39b8030dd8fcf99b063d83232d", @@ -49,12 +65,20 @@ exports.LOGIN_CONSENT_DECISION_VDXF_KEY = { name: "vrsc::system.identity.authentication.loginconsent.response.decision", }, }; -exports.LOGIN_CONSENT_CLIENT_VDXF_KEY = { - vdxfid: "iPuyaAq8PNetbcP5ut2RJFJBZ7YkowevQK", - hash160result: "0aee6fd3bc6bad9287c5449620cc5e4023bc32e0", +exports.LOGIN_CONSENT_OIDC_DECISION_VDXF_KEY = { + "vdxfid": "i49KeF2Ucd2NukXTbP2ArHX2JUtfqZRC63", + "hash160result": "890efbba846eac07b3220d197cfe9f2269615607", + "qualifiedname": { + "namespace": "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + "name": "vrsc::system.identity.authentication.loginconsent.response.oidcdecision" + } +}; +exports.LOGIN_CONSENT_OIDC_CLIENT_VDXF_KEY = { + vdxfid: "iGo5omf7RubucEU6nM6THM6bhPgq1SjSqS", + hash160result: "e3187c990ff432ba56cf3180b3661bcca0251c92", qualifiedname: { namespace: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", - name: "vrsc::system.identity.authentication.loginconsent.client", + name: "vrsc::system.identity.authentication.loginconsent.oidcclient", }, }; exports.WALLET_VDXF_KEY = { diff --git a/src/vdxf/classes/Challenge.ts b/src/vdxf/classes/Challenge.ts index 947e617f..f3bda3d4 100644 --- a/src/vdxf/classes/Challenge.ts +++ b/src/vdxf/classes/Challenge.ts @@ -1,83 +1,121 @@ -import { Client, ClientInterface } from "./Client"; import { LOGIN_CONSENT_CHALLENGE_VDXF_KEY, VDXFObject } from "../"; +export class RedirectUri extends VDXFObject { + uri: string; + + constructor(uri: string, vdxfkey: string) { + super(vdxfkey); + + this.uri = uri + } + + stringable() { + return { + uri: this.uri, + vdxfkey: this.vdxfkey + }; + } +} + +export class Subject extends VDXFObject { + data: string; + + constructor(data: string, vdxfkey: string) { + super(vdxfkey); + + this.data = data + } + + stringable() { + return { + data: this.data, + vdxfkey: this.vdxfkey + }; + } +} + export interface ChallengeInterface { - uuid: string; - requested_scope?: Array | null; - requested_access_token_audience?: Array | null; - skip?: boolean; - subject?: string; - oidc_context?: - | { - acr_values: Array; - display: string; - id_token_hint_claims: { [key: string]: any }; - login_hint: string; - ui_locales: Array; - } - | {}; - request_url?: string; - login_challenge?: string; - login_session_id?: string; - acr?: string; + // Challenge specific VDXF key + challenge_id: string; + + // VDXF keys array of access requests + requested_access?: Array | null; + + // Array of members that will have access to scope + requested_access_audience?: Array | null; + + // Information about the ID you have to log in with, array of VDXF objects + subject?: Array; + + // Array of alternate authentication factors required + alt_auth_factors?: Array | null; + + // Temporary session ID session_id?: string; - client: ClientInterface; + + // List of signatures, IDs and trust score objects + attestations?: null; + + // Array of VDXF objects defining behaviour on deeplink complete + redirect_uris?: Array; + + // String of unix representation of date string + created_at?: string; + + // Random hash string + salt: string; + + // Context + context: { [key: string]: any }; } -export class Challenge extends VDXFObject { - uuid: string = ""; - client: Client; - requested_scope?: Array | null; - requested_access_token_audience?: Array | null; - skip?: boolean; - subject?: string; - oidc_context?: - | { - acr_values: Array; - display: string; - id_token_hint_claims: { [key: string]: any }; - login_hint: string; - ui_locales: Array; - } - | {}; - request_url?: string; - login_challenge?: string; - login_session_id?: string; - acr?: string; +export class Challenge extends VDXFObject implements ChallengeInterface { + challenge_id: string; + requested_access?: Array | null; + requested_access_audience?: Array | null; + subject?: Array; + alt_auth_factors?: Array | null; session_id?: string; + attestations?: null; + redirect_uris?: Array; + created_at?: string; + salt: string; + context: { [key: string]: any }; constructor(challenge: ChallengeInterface) { super(LOGIN_CONSENT_CHALLENGE_VDXF_KEY.vdxfid) - this.uuid = challenge.uuid; - this.requested_scope = challenge.requested_scope; - this.requested_access_token_audience = challenge.requested_access_token_audience; - this.skip = challenge.skip; + this.challenge_id = challenge.challenge_id; + this.requested_access = challenge.requested_access; + this.requested_access_audience = challenge.requested_access_audience; this.subject = challenge.subject; - this.oidc_context = challenge.oidc_context; - this.request_url = challenge.request_url; - this.login_challenge = challenge.login_challenge; - this.login_session_id = challenge.login_session_id; - this.acr = challenge.acr; + this.alt_auth_factors = challenge.alt_auth_factors; this.session_id = challenge.session_id; - this.client = new Client(challenge.client); + this.attestations = challenge.attestations; + this.redirect_uris = challenge.redirect_uris + ? challenge.redirect_uris.map((x) => new RedirectUri(x.uri, x.vdxfkey)) + : challenge.redirect_uris; + this.created_at = challenge.created_at; + this.salt = challenge.salt; + this.context = challenge.context; } stringable() { return { vdxfkey: this.vdxfkey, - uuid: this.uuid, - client: this.client.stringable(), - requested_scope: this.requested_scope, - requested_access_token_audience: this.requested_access_token_audience, - skip: this.skip, + challenge_id: this.challenge_id, + requested_access: this.requested_access, + requested_access_audience: this.requested_access_audience, subject: this.subject, - oidc_context: this.oidc_context, - request_url: this.request_url, - login_challenge: this.login_challenge, - login_session_id: this.login_session_id, - acr: this.acr, + alt_auth_factors: this.alt_auth_factors, session_id: this.session_id, + attestations: this.attestations, + redirect_uris: this.redirect_uris + ? this.redirect_uris.map((x) => x.stringable()) + : this.redirect_uris, + created_at: this.created_at, + salt: this.salt, + context: this.context }; } } \ No newline at end of file diff --git a/src/vdxf/classes/Decision.ts b/src/vdxf/classes/Decision.ts index 18864ce7..f23386d4 100644 --- a/src/vdxf/classes/Decision.ts +++ b/src/vdxf/classes/Decision.ts @@ -1,66 +1,74 @@ -import { LOGIN_CONSENT_DECISION_VDXF_KEY, VDXFObject } from "../"; +import { LOGIN_CONSENT_DECISION_VDXF_KEY, VDXFObject } from ".."; +import { OidcChallenge } from "./oidc/OidcChallenge"; +import { OidcClient } from "./oidc/OidcClient"; +import { OidcDecision } from "./oidc/OidcDecision"; +import { OidcRequest } from "./oidc/OidcRequest"; import { Request, RequestInterface } from "./Request"; export interface DecisionInterface { - subject?: string; - remember?: boolean; - remember_for?: number; - acr?: string; - context?: { [key: string]: any }; - force_subject_identifier?: string; - error?: string; - error_description?: string; - error_hint?: string; - error_debug?: string; - status_code?: number; + // Decision specific VDXF key + decision_id: string; + + // Request that is request: RequestInterface; + + // String of unix representation of date string + created_at?: string; + + // General context + context?: { [key: string]: any }; } export class Decision extends VDXFObject { - subject?: string; - remember?: boolean; - remember_for?: number; - acr?: string; + decision_id: string; context?: { [key: string]: any }; - force_subject_identifier?: string; - error?: string; - error_description?: string; - error_hint?: string; - error_debug?: string; - status_code?: number; request: Request; + created_at: string; constructor(decision: DecisionInterface) { super(LOGIN_CONSENT_DECISION_VDXF_KEY.vdxfid) - this.subject = decision.subject; - this.remember = decision.remember; - this.remember_for = decision.remember_for; - this.acr = decision.acr; - this.context = decision.context; - this.force_subject_identifier = decision.force_subject_identifier; - this.error = decision.error; - this.error_description = decision.error_description; - this.error_hint = decision.error_hint; - this.error_debug = decision.error_debug; - this.status_code = decision.status_code; + this.decision_id = decision.decision_id; this.request = new Request(decision.request); + this.context = decision.context; + this.created_at = decision.created_at; + } + + toOidcDecision(): OidcDecision { + return new OidcDecision({ + subject: this.request.challenge.subject ? JSON.stringify(this.request.challenge.subject) : undefined, + context: this.context, + request: new OidcRequest({ + chain_id: this.request.chain_id, + signing_id: this.request.signing_id, + signature: this.request.signature, + challenge: new OidcChallenge({ + uuid: this.request.challenge.challenge_id, + requested_scope: this.request.challenge.requested_access, + requested_access_token_audience: this.request.challenge.requested_access_audience, + subject: this.request.challenge.subject ? JSON.stringify(this.request.challenge.subject) : undefined, + session_id: this.request.challenge.session_id, + client: new OidcClient({ + client_id: this.request.challenge.challenge_id, + redirect_uris: this.request.challenge.redirect_uris ? this.request.challenge.redirect_uris.map(x => { + return { + type: x.vdxfkey, + uri: x.uri + } + }) : undefined, + created_at: this.request.challenge.created_at + }) + }) + }) + }) } stringable() { return { vdxfkey: this.vdxfkey, - subject: this.subject, - remember: this.remember, - remember_for: this.remember_for, - acr: this.acr, + decision_id: this.decision_id, context: this.context, - force_subject_identifier: this.force_subject_identifier, - error: this.error, - error_description: this.error_description, - error_hint: this.error_hint, - error_debug: this.error_debug, - status_code: this.status_code, + created_at: this.created_at, request: this.request.stringable(), }; } diff --git a/src/vdxf/classes/index.ts b/src/vdxf/classes/index.ts index 834a68cf..8526e7f7 100644 --- a/src/vdxf/classes/index.ts +++ b/src/vdxf/classes/index.ts @@ -1,5 +1,8 @@ -export { Decision as LoginConsentDecision } from './Decision' export { Challenge as LoginConsentChallenge } from './Challenge' -export { Client as LoginConsentClient } from './Client' +export { Decision as LoginConsentDecision } from './Decision' export { Request as LoginConsentRequest } from './Request' -export { Response as LoginConsentResponse } from './Response' \ No newline at end of file +export { Response as LoginConsentResponse } from './Response' + +export { OidcClient as OidcLoginConsentClient } from './oidc/OidcClient' +export { OidcChallenge as OidcLoginConsentChallenge } from './oidc/OidcChallenge' +export { OidcDecision as OidcLoginConsentDecision } from './oidc/OidcDecision' \ No newline at end of file diff --git a/src/vdxf/classes/oidc/OidcChallenge.ts b/src/vdxf/classes/oidc/OidcChallenge.ts new file mode 100644 index 00000000..e8fb6682 --- /dev/null +++ b/src/vdxf/classes/oidc/OidcChallenge.ts @@ -0,0 +1,83 @@ +import { OidcClient, OidcClientInterface } from "./OidcClient"; +import { LOGIN_CONSENT_OIDC_CHALLENGE_VDXF_KEY, VDXFObject } from "../.."; + +export interface OidcChallengeInterface { + uuid: string; + requested_scope?: Array | null; + requested_access_token_audience?: Array | null; + skip?: boolean; + subject?: string; + oidc_context?: + | { + acr_values: Array; + display: string; + id_token_hint_claims: { [key: string]: any }; + login_hint: string; + ui_locales: Array; + } + | {}; + request_url?: string; + login_challenge?: string; + login_session_id?: string; + acr?: string; + session_id?: string; + client: OidcClientInterface; +} + +export class OidcChallenge extends VDXFObject { + uuid: string = ""; + client: OidcClient; + requested_scope?: Array | null; + requested_access_token_audience?: Array | null; + skip?: boolean; + subject?: string; + oidc_context?: + | { + acr_values: Array; + display: string; + id_token_hint_claims: { [key: string]: any }; + login_hint: string; + ui_locales: Array; + } + | {}; + request_url?: string; + login_challenge?: string; + login_session_id?: string; + acr?: string; + session_id?: string; + + constructor(challenge: OidcChallengeInterface) { + super(LOGIN_CONSENT_OIDC_CHALLENGE_VDXF_KEY.vdxfid) + + this.uuid = challenge.uuid; + this.requested_scope = challenge.requested_scope; + this.requested_access_token_audience = challenge.requested_access_token_audience; + this.skip = challenge.skip; + this.subject = challenge.subject; + this.oidc_context = challenge.oidc_context; + this.request_url = challenge.request_url; + this.login_challenge = challenge.login_challenge; + this.login_session_id = challenge.login_session_id; + this.acr = challenge.acr; + this.session_id = challenge.session_id; + this.client = new OidcClient(challenge.client); + } + + stringable() { + return { + vdxfkey: this.vdxfkey, + uuid: this.uuid, + client: this.client.stringable(), + requested_scope: this.requested_scope, + requested_access_token_audience: this.requested_access_token_audience, + skip: this.skip, + subject: this.subject, + oidc_context: this.oidc_context, + request_url: this.request_url, + login_challenge: this.login_challenge, + login_session_id: this.login_session_id, + acr: this.acr, + session_id: this.session_id, + }; + } +} \ No newline at end of file diff --git a/src/vdxf/classes/Client.ts b/src/vdxf/classes/oidc/OidcClient.ts similarity index 92% rename from src/vdxf/classes/Client.ts rename to src/vdxf/classes/oidc/OidcClient.ts index 593f73af..62e5a47c 100644 --- a/src/vdxf/classes/Client.ts +++ b/src/vdxf/classes/oidc/OidcClient.ts @@ -1,11 +1,11 @@ -import { LOGIN_CONSENT_CLIENT_VDXF_KEY, VDXFObject } from "../"; +import { LOGIN_CONSENT_OIDC_CLIENT_VDXF_KEY, VDXFObject } from "../../"; export interface RedirectUri { type: string; uri: string; } -export interface ClientInterface { +export interface OidcClientInterface { client_id: string; name?: string; redirect_uris?: Array; @@ -28,7 +28,7 @@ export interface ClientInterface { updated_at?: string; } -export class Client extends VDXFObject { +export class OidcClient extends VDXFObject { client_id: string; name?: string; redirect_uris?: Array; @@ -50,8 +50,8 @@ export class Client extends VDXFObject { created_at: string; updated_at?: string; - constructor(client: ClientInterface) { - super(LOGIN_CONSENT_CLIENT_VDXF_KEY.vdxfid) + constructor(client: OidcClientInterface) { + super(LOGIN_CONSENT_OIDC_CLIENT_VDXF_KEY.vdxfid) this.client_id = client.client_id; this.name = client.name; diff --git a/src/vdxf/classes/oidc/OidcDecision.ts b/src/vdxf/classes/oidc/OidcDecision.ts new file mode 100644 index 00000000..e4131e24 --- /dev/null +++ b/src/vdxf/classes/oidc/OidcDecision.ts @@ -0,0 +1,67 @@ +import { LOGIN_CONSENT_OIDC_DECISION_VDXF_KEY, VDXFObject } from "../../"; +import { OidcRequest, OidcRequestInterface } from "./OidcRequest"; + +export interface OidcDecisionInterface { + subject?: string; + remember?: boolean; + remember_for?: number; + acr?: string; + context?: { [key: string]: any }; + force_subject_identifier?: string; + error?: string; + error_description?: string; + error_hint?: string; + error_debug?: string; + status_code?: number; + request: OidcRequestInterface; +} + +export class OidcDecision extends VDXFObject { + subject?: string; + remember?: boolean; + remember_for?: number; + acr?: string; + context?: { [key: string]: any }; + force_subject_identifier?: string; + error?: string; + error_description?: string; + error_hint?: string; + error_debug?: string; + status_code?: number; + request: OidcRequest; + + constructor(decision: OidcDecisionInterface) { + super(LOGIN_CONSENT_OIDC_DECISION_VDXF_KEY.vdxfid) + + this.subject = decision.subject; + this.remember = decision.remember; + this.remember_for = decision.remember_for; + this.acr = decision.acr; + this.context = decision.context; + this.force_subject_identifier = decision.force_subject_identifier; + this.error = decision.error; + this.error_description = decision.error_description; + this.error_hint = decision.error_hint; + this.error_debug = decision.error_debug; + this.status_code = decision.status_code; + this.request = new OidcRequest(decision.request); + } + + stringable() { + return { + vdxfkey: this.vdxfkey, + subject: this.subject, + remember: this.remember, + remember_for: this.remember_for, + acr: this.acr, + context: this.context, + force_subject_identifier: this.force_subject_identifier, + error: this.error, + error_description: this.error_description, + error_hint: this.error_hint, + error_debug: this.error_debug, + status_code: this.status_code, + request: this.request.stringable(), + }; + } +} \ No newline at end of file diff --git a/src/vdxf/classes/oidc/OidcRequest.ts b/src/vdxf/classes/oidc/OidcRequest.ts new file mode 100644 index 00000000..979867f8 --- /dev/null +++ b/src/vdxf/classes/oidc/OidcRequest.ts @@ -0,0 +1,40 @@ +import { LOGIN_CONSENT_OIDC_REQUEST_VDXF_KEY, VDXFObject, VerusIDSignature, VerusIDSignatureInterface } from "../.."; +import { LOGIN_CONSENT_REQUEST_SIG_VDXF_KEY } from "../../keys"; +import { OidcChallenge, OidcChallengeInterface } from "./OidcChallenge"; + +export interface OidcRequestInterface { + chain_id: string; + signing_id: string; + signature: VerusIDSignatureInterface; + challenge: OidcChallengeInterface; +} + +export class OidcRequest extends VDXFObject { + chain_id: string; + signing_id: string; + signature: VerusIDSignature; + challenge: OidcChallenge; + + constructor(request: OidcRequestInterface) { + super(LOGIN_CONSENT_OIDC_REQUEST_VDXF_KEY.vdxfid); + + this.chain_id = request.chain_id; + this.signing_id = request.signing_id; + this.signature = new VerusIDSignature(request.signature, LOGIN_CONSENT_REQUEST_SIG_VDXF_KEY); + this.challenge = new OidcChallenge(request.challenge); + } + + getSignedData() { + return this.challenge.toString(); + } + + stringable() { + return { + vdxfkey: this.vdxfkey, + chain_id: this.chain_id, + signing_id: this.signing_id, + signature: this.signature.stringable(), + challenge: this.challenge.stringable(), + }; + } +} diff --git a/src/vdxf/index.ts b/src/vdxf/index.ts index 3ac388d8..782524bb 100644 --- a/src/vdxf/index.ts +++ b/src/vdxf/index.ts @@ -42,4 +42,4 @@ export class VerusIDSignature extends VDXFObject { signature: this.signature, }; } -} +} \ No newline at end of file diff --git a/src/vdxf/keys.ts b/src/vdxf/keys.ts index 13b1968f..9483e850 100644 --- a/src/vdxf/keys.ts +++ b/src/vdxf/keys.ts @@ -35,6 +35,15 @@ export const LOGIN_CONSENT_REQUEST_VDXF_KEY: VDXFKeyInterface = { }, }; +export const LOGIN_CONSENT_OIDC_REQUEST_VDXF_KEY: VDXFKeyInterface = { + "vdxfid": "i5XKaak5R68S1oW55dDDu7XEkRZpRTFts6", + "hash160result": "e19a485ca8bce6540ace5f40e415a4a7d29a7716", + "qualifiedname": { + "namespace": "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + "name": "vrsc::system.identity.authentication.loginconsent.oidcrequest" + } +} + export const LOGIN_CONSENT_RESPONSE_VDXF_KEY: VDXFKeyInterface = { vdxfid: "iJQaibDkoUxwGoE2YhZtVVZyhKxZs1G7uU", hash160result: "a77ba0f8c5a05fcc1ef0fa0ed93dab1501f7caa3", @@ -53,6 +62,15 @@ export const LOGIN_CONSENT_CHALLENGE_VDXF_KEY: VDXFKeyInterface = { }, }; +export const LOGIN_CONSENT_OIDC_CHALLENGE_VDXF_KEY: VDXFKeyInterface = { + vdxfid: "iNiZWvtDmXSeYKNvu8GNZwCT3J9qFMrJwx", + hash160result: "6c52ec072c07c0b15d5b46f67e18547ce5f311d3", + qualifiedname: { + namespace: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + name: "vrsc::system.identity.authentication.loginconsent.request.oidcchallenge", + }, +}; + export const LOGIN_CONSENT_DECISION_VDXF_KEY: VDXFKeyInterface = { vdxfid: "i7bCPAtS12cKwa7VevVZqgRusN4NXVCt5z", hash160result: "b870b7693cc7de39b8030dd8fcf99b063d83232d", @@ -62,12 +80,21 @@ export const LOGIN_CONSENT_DECISION_VDXF_KEY: VDXFKeyInterface = { }, }; -export const LOGIN_CONSENT_CLIENT_VDXF_KEY: VDXFKeyInterface = { - vdxfid: "iPuyaAq8PNetbcP5ut2RJFJBZ7YkowevQK", - hash160result: "0aee6fd3bc6bad9287c5449620cc5e4023bc32e0", +export const LOGIN_CONSENT_OIDC_DECISION_VDXF_KEY: VDXFKeyInterface = { + "vdxfid": "i49KeF2Ucd2NukXTbP2ArHX2JUtfqZRC63", + "hash160result": "890efbba846eac07b3220d197cfe9f2269615607", + "qualifiedname": { + "namespace": "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + "name": "vrsc::system.identity.authentication.loginconsent.response.oidcdecision" + } +} + +export const LOGIN_CONSENT_OIDC_CLIENT_VDXF_KEY: VDXFKeyInterface = { + vdxfid: "iGo5omf7RubucEU6nM6THM6bhPgq1SjSqS", + hash160result: "e3187c990ff432ba56cf3180b3661bcca0251c92", qualifiedname: { namespace: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", - name: "vrsc::system.identity.authentication.loginconsent.client", + name: "vrsc::system.identity.authentication.loginconsent.oidcclient", }, }; From 6ae4b9dd183538642af57ee9730d6a2e2366c008 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Mon, 26 Sep 2022 15:40:10 +0200 Subject: [PATCH 2/6] Change chain_id to system_id --- dist/vdxf/classes/Decision.d.ts | 2 +- dist/vdxf/classes/Decision.js | 2 +- dist/vdxf/classes/Request.d.ts | 6 +++--- dist/vdxf/classes/Request.js | 4 ++-- dist/vdxf/classes/Response.d.ts | 8 ++++---- dist/vdxf/classes/Response.js | 4 ++-- src/vdxf/classes/Decision.ts | 2 +- src/vdxf/classes/Request.ts | 8 ++++---- src/vdxf/classes/Response.ts | 8 ++++---- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/dist/vdxf/classes/Decision.d.ts b/dist/vdxf/classes/Decision.d.ts index 1fa439fc..e68c7741 100644 --- a/dist/vdxf/classes/Decision.d.ts +++ b/dist/vdxf/classes/Decision.d.ts @@ -27,7 +27,7 @@ export declare class Decision extends VDXFObject { created_at: string; request: { vdxfkey: string; - chain_id: string; + system_id: string; signing_id: string; signature: { vdxfkey: string; diff --git a/dist/vdxf/classes/Decision.js b/dist/vdxf/classes/Decision.js index 22d4d468..eda2fa0b 100644 --- a/dist/vdxf/classes/Decision.js +++ b/dist/vdxf/classes/Decision.js @@ -20,7 +20,7 @@ class Decision extends __1.VDXFObject { subject: this.request.challenge.subject ? JSON.stringify(this.request.challenge.subject) : undefined, context: this.context, request: new OidcRequest_1.OidcRequest({ - chain_id: this.request.chain_id, + chain_id: this.request.system_id, signing_id: this.request.signing_id, signature: this.request.signature, challenge: new OidcChallenge_1.OidcChallenge({ diff --git a/dist/vdxf/classes/Request.d.ts b/dist/vdxf/classes/Request.d.ts index d131252d..6c0cf74f 100644 --- a/dist/vdxf/classes/Request.d.ts +++ b/dist/vdxf/classes/Request.d.ts @@ -1,13 +1,13 @@ import { VDXFObject, VerusIDSignature, VerusIDSignatureInterface } from "../"; import { Challenge, ChallengeInterface } from "./Challenge"; export interface RequestInterface { - chain_id: string; + system_id: string; signing_id: string; signature: VerusIDSignatureInterface; challenge: ChallengeInterface; } export declare class Request extends VDXFObject { - chain_id: string; + system_id: string; signing_id: string; signature: VerusIDSignature; challenge: Challenge; @@ -15,7 +15,7 @@ export declare class Request extends VDXFObject { getSignedData(): string; stringable(): { vdxfkey: string; - chain_id: string; + system_id: string; signing_id: string; signature: { vdxfkey: string; diff --git a/dist/vdxf/classes/Request.js b/dist/vdxf/classes/Request.js index 75d0d65e..608e0b46 100644 --- a/dist/vdxf/classes/Request.js +++ b/dist/vdxf/classes/Request.js @@ -7,7 +7,7 @@ const Challenge_1 = require("./Challenge"); class Request extends __1.VDXFObject { constructor(request) { super(__1.LOGIN_CONSENT_REQUEST_VDXF_KEY.vdxfid); - this.chain_id = request.chain_id; + this.system_id = request.system_id; this.signing_id = request.signing_id; this.signature = new __1.VerusIDSignature(request.signature, keys_1.LOGIN_CONSENT_REQUEST_SIG_VDXF_KEY); this.challenge = new Challenge_1.Challenge(request.challenge); @@ -18,7 +18,7 @@ class Request extends __1.VDXFObject { stringable() { return { vdxfkey: this.vdxfkey, - chain_id: this.chain_id, + system_id: this.system_id, signing_id: this.signing_id, signature: this.signature.stringable(), challenge: this.challenge.stringable(), diff --git a/dist/vdxf/classes/Response.d.ts b/dist/vdxf/classes/Response.d.ts index 1f92a732..94c144f5 100644 --- a/dist/vdxf/classes/Response.d.ts +++ b/dist/vdxf/classes/Response.d.ts @@ -1,13 +1,13 @@ import { Decision, DecisionInterface } from "./Decision"; import { VDXFObject, VerusIDSignature, VerusIDSignatureInterface } from "../"; interface ResponseInterface { - chain_id: string; + system_id: string; signing_id: string; signature?: VerusIDSignatureInterface; decision: DecisionInterface; } export declare class Response extends VDXFObject { - chain_id: string; + system_id: string; signing_id: string; signature?: VerusIDSignature; decision: Decision; @@ -15,7 +15,7 @@ export declare class Response extends VDXFObject { getSignedData(): string; stringable(): { vdxfkey: string; - chain_id: string; + system_id: string; signature: VerusIDSignature; signing_id: string; decision: { @@ -27,7 +27,7 @@ export declare class Response extends VDXFObject { created_at: string; request: { vdxfkey: string; - chain_id: string; + system_id: string; signing_id: string; signature: { vdxfkey: string; diff --git a/dist/vdxf/classes/Response.js b/dist/vdxf/classes/Response.js index 63b481b6..03f0451b 100644 --- a/dist/vdxf/classes/Response.js +++ b/dist/vdxf/classes/Response.js @@ -7,7 +7,7 @@ const keys_1 = require("../keys"); class Response extends __1.VDXFObject { constructor(response) { super(__1.LOGIN_CONSENT_RESPONSE_VDXF_KEY.vdxfid); - this.chain_id = response.chain_id; + this.system_id = response.system_id; this.signing_id = response.signing_id; this.decision = new Decision_1.Decision(response.decision); if (response.signature) { @@ -20,7 +20,7 @@ class Response extends __1.VDXFObject { stringable() { return { vdxfkey: this.vdxfkey, - chain_id: this.chain_id, + system_id: this.system_id, signature: this.signature, signing_id: this.signing_id, decision: this.decision.stringable() diff --git a/src/vdxf/classes/Decision.ts b/src/vdxf/classes/Decision.ts index f23386d4..b4b667b0 100644 --- a/src/vdxf/classes/Decision.ts +++ b/src/vdxf/classes/Decision.ts @@ -39,7 +39,7 @@ export class Decision extends VDXFObject { subject: this.request.challenge.subject ? JSON.stringify(this.request.challenge.subject) : undefined, context: this.context, request: new OidcRequest({ - chain_id: this.request.chain_id, + chain_id: this.request.system_id, signing_id: this.request.signing_id, signature: this.request.signature, challenge: new OidcChallenge({ diff --git a/src/vdxf/classes/Request.ts b/src/vdxf/classes/Request.ts index 355540e9..f5e0dc2b 100644 --- a/src/vdxf/classes/Request.ts +++ b/src/vdxf/classes/Request.ts @@ -3,14 +3,14 @@ import { LOGIN_CONSENT_REQUEST_SIG_VDXF_KEY } from "../keys"; import { Challenge, ChallengeInterface } from "./Challenge"; export interface RequestInterface { - chain_id: string; + system_id: string; signing_id: string; signature: VerusIDSignatureInterface; challenge: ChallengeInterface; } export class Request extends VDXFObject { - chain_id: string; + system_id: string; signing_id: string; signature: VerusIDSignature; challenge: Challenge; @@ -18,7 +18,7 @@ export class Request extends VDXFObject { constructor(request: RequestInterface) { super(LOGIN_CONSENT_REQUEST_VDXF_KEY.vdxfid); - this.chain_id = request.chain_id; + this.system_id = request.system_id; this.signing_id = request.signing_id; this.signature = new VerusIDSignature(request.signature, LOGIN_CONSENT_REQUEST_SIG_VDXF_KEY); this.challenge = new Challenge(request.challenge); @@ -31,7 +31,7 @@ export class Request extends VDXFObject { stringable() { return { vdxfkey: this.vdxfkey, - chain_id: this.chain_id, + system_id: this.system_id, signing_id: this.signing_id, signature: this.signature.stringable(), challenge: this.challenge.stringable(), diff --git a/src/vdxf/classes/Response.ts b/src/vdxf/classes/Response.ts index e83f37ca..52a60480 100644 --- a/src/vdxf/classes/Response.ts +++ b/src/vdxf/classes/Response.ts @@ -3,14 +3,14 @@ import { LOGIN_CONSENT_RESPONSE_VDXF_KEY, VDXFObject, VerusIDSignature, VerusIDS import { LOGIN_CONSENT_RESPONSE_SIG_VDXF_KEY } from "../keys"; interface ResponseInterface { - chain_id: string; + system_id: string; signing_id: string; signature?: VerusIDSignatureInterface; decision: DecisionInterface; } export class Response extends VDXFObject { - chain_id: string; + system_id: string; signing_id: string; signature?: VerusIDSignature; decision: Decision; @@ -18,7 +18,7 @@ export class Response extends VDXFObject { constructor(response: ResponseInterface) { super(LOGIN_CONSENT_RESPONSE_VDXF_KEY.vdxfid) - this.chain_id = response.chain_id; + this.system_id = response.system_id; this.signing_id = response.signing_id; this.decision = new Decision(response.decision); @@ -37,7 +37,7 @@ export class Response extends VDXFObject { stringable() { return { vdxfkey: this.vdxfkey, - chain_id: this.chain_id, + system_id: this.system_id, signature: this.signature, signing_id: this.signing_id, decision: this.decision.stringable() From 91044a3e85e1c31ec66646e02da798bc63825da6 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Mon, 26 Sep 2022 15:54:51 +0200 Subject: [PATCH 3/6] Export login consent interfaces --- dist/vdxf/classes/Response.d.ts | 3 +-- dist/vdxf/classes/index.d.ts | 4 ++++ src/vdxf/classes/Response.ts | 2 +- src/vdxf/classes/index.ts | 4 ++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dist/vdxf/classes/Response.d.ts b/dist/vdxf/classes/Response.d.ts index 94c144f5..c85a8171 100644 --- a/dist/vdxf/classes/Response.d.ts +++ b/dist/vdxf/classes/Response.d.ts @@ -1,6 +1,6 @@ import { Decision, DecisionInterface } from "./Decision"; import { VDXFObject, VerusIDSignature, VerusIDSignatureInterface } from "../"; -interface ResponseInterface { +export interface ResponseInterface { system_id: string; signing_id: string; signature?: VerusIDSignatureInterface; @@ -56,4 +56,3 @@ export declare class Response extends VDXFObject { }; }; } -export {}; diff --git a/dist/vdxf/classes/index.d.ts b/dist/vdxf/classes/index.d.ts index ff4f15d2..9ac3cce5 100644 --- a/dist/vdxf/classes/index.d.ts +++ b/dist/vdxf/classes/index.d.ts @@ -2,6 +2,10 @@ export { Challenge as LoginConsentChallenge } from './Challenge'; export { Decision as LoginConsentDecision } from './Decision'; export { Request as LoginConsentRequest } from './Request'; export { Response as LoginConsentResponse } from './Response'; +export { ChallengeInterface as LoginConsentChallengeInterface } from './Challenge'; +export { DecisionInterface as LoginConsentDecisionInterface } from './Decision'; +export { RequestInterface as LoginConsentRequestInterface } from './Request'; +export { ResponseInterface as LoginConsentResponseInterface } from './Response'; export { OidcClient as OidcLoginConsentClient } from './oidc/OidcClient'; export { OidcChallenge as OidcLoginConsentChallenge } from './oidc/OidcChallenge'; export { OidcDecision as OidcLoginConsentDecision } from './oidc/OidcDecision'; diff --git a/src/vdxf/classes/Response.ts b/src/vdxf/classes/Response.ts index 52a60480..39508210 100644 --- a/src/vdxf/classes/Response.ts +++ b/src/vdxf/classes/Response.ts @@ -2,7 +2,7 @@ import { Decision, DecisionInterface } from "./Decision"; import { LOGIN_CONSENT_RESPONSE_VDXF_KEY, VDXFObject, VerusIDSignature, VerusIDSignatureInterface } from "../"; import { LOGIN_CONSENT_RESPONSE_SIG_VDXF_KEY } from "../keys"; -interface ResponseInterface { +export interface ResponseInterface { system_id: string; signing_id: string; signature?: VerusIDSignatureInterface; diff --git a/src/vdxf/classes/index.ts b/src/vdxf/classes/index.ts index 8526e7f7..607a591a 100644 --- a/src/vdxf/classes/index.ts +++ b/src/vdxf/classes/index.ts @@ -2,6 +2,10 @@ export { Challenge as LoginConsentChallenge } from './Challenge' export { Decision as LoginConsentDecision } from './Decision' export { Request as LoginConsentRequest } from './Request' export { Response as LoginConsentResponse } from './Response' +export { ChallengeInterface as LoginConsentChallengeInterface } from './Challenge' +export { DecisionInterface as LoginConsentDecisionInterface } from './Decision' +export { RequestInterface as LoginConsentRequestInterface } from './Request' +export { ResponseInterface as LoginConsentResponseInterface } from './Response' export { OidcClient as OidcLoginConsentClient } from './oidc/OidcClient' export { OidcChallenge as OidcLoginConsentChallenge } from './oidc/OidcChallenge' From 3f85a410d9f5153122952969320d2835ed90e873 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Mon, 26 Sep 2022 16:07:26 +0200 Subject: [PATCH 4/6] Make signature optional param for login consent request --- dist/vdxf/classes/Request.d.ts | 4 ++-- dist/vdxf/classes/Request.js | 6 ++++-- src/vdxf/classes/Request.ts | 13 +++++++++---- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/dist/vdxf/classes/Request.d.ts b/dist/vdxf/classes/Request.d.ts index 6c0cf74f..59dca36c 100644 --- a/dist/vdxf/classes/Request.d.ts +++ b/dist/vdxf/classes/Request.d.ts @@ -3,13 +3,13 @@ import { Challenge, ChallengeInterface } from "./Challenge"; export interface RequestInterface { system_id: string; signing_id: string; - signature: VerusIDSignatureInterface; + signature?: VerusIDSignatureInterface; challenge: ChallengeInterface; } export declare class Request extends VDXFObject { system_id: string; signing_id: string; - signature: VerusIDSignature; + signature?: VerusIDSignature; challenge: Challenge; constructor(request: RequestInterface); getSignedData(): string; diff --git a/dist/vdxf/classes/Request.js b/dist/vdxf/classes/Request.js index 608e0b46..efcfc8c1 100644 --- a/dist/vdxf/classes/Request.js +++ b/dist/vdxf/classes/Request.js @@ -9,7 +9,9 @@ class Request extends __1.VDXFObject { super(__1.LOGIN_CONSENT_REQUEST_VDXF_KEY.vdxfid); this.system_id = request.system_id; this.signing_id = request.signing_id; - this.signature = new __1.VerusIDSignature(request.signature, keys_1.LOGIN_CONSENT_REQUEST_SIG_VDXF_KEY); + this.signature = request.signature + ? new __1.VerusIDSignature(request.signature, keys_1.LOGIN_CONSENT_REQUEST_SIG_VDXF_KEY) + : undefined; this.challenge = new Challenge_1.Challenge(request.challenge); } getSignedData() { @@ -20,7 +22,7 @@ class Request extends __1.VDXFObject { vdxfkey: this.vdxfkey, system_id: this.system_id, signing_id: this.signing_id, - signature: this.signature.stringable(), + signature: this.signature ? this.signature.stringable() : this.signature, challenge: this.challenge.stringable(), }; } diff --git a/src/vdxf/classes/Request.ts b/src/vdxf/classes/Request.ts index f5e0dc2b..fe37e92f 100644 --- a/src/vdxf/classes/Request.ts +++ b/src/vdxf/classes/Request.ts @@ -5,14 +5,14 @@ import { Challenge, ChallengeInterface } from "./Challenge"; export interface RequestInterface { system_id: string; signing_id: string; - signature: VerusIDSignatureInterface; + signature?: VerusIDSignatureInterface; challenge: ChallengeInterface; } export class Request extends VDXFObject { system_id: string; signing_id: string; - signature: VerusIDSignature; + signature?: VerusIDSignature; challenge: Challenge; constructor(request: RequestInterface) { @@ -20,7 +20,12 @@ export class Request extends VDXFObject { this.system_id = request.system_id; this.signing_id = request.signing_id; - this.signature = new VerusIDSignature(request.signature, LOGIN_CONSENT_REQUEST_SIG_VDXF_KEY); + this.signature = request.signature + ? new VerusIDSignature( + request.signature, + LOGIN_CONSENT_REQUEST_SIG_VDXF_KEY + ) + : undefined; this.challenge = new Challenge(request.challenge); } @@ -33,7 +38,7 @@ export class Request extends VDXFObject { vdxfkey: this.vdxfkey, system_id: this.system_id, signing_id: this.signing_id, - signature: this.signature.stringable(), + signature: this.signature ? this.signature.stringable() : this.signature, challenge: this.challenge.stringable(), }; } From 42dd28d5db2859c3d09176c035bb233c5b95fccb Mon Sep 17 00:00:00 2001 From: michaeltout Date: Mon, 26 Sep 2022 16:27:22 +0200 Subject: [PATCH 5/6] Add toWalletDeeplinkUri and fromWalletDeeplinkUri to request class --- dist/vdxf/classes/Request.d.ts | 2 ++ dist/vdxf/classes/Request.js | 9 +++++++++ package.json | 8 +++++++- src/vdxf/classes/Request.ts | 24 +++++++++++++++++++++++- yarn.lock | 13 +++++++++++++ 5 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 yarn.lock diff --git a/dist/vdxf/classes/Request.d.ts b/dist/vdxf/classes/Request.d.ts index 59dca36c..07a358f2 100644 --- a/dist/vdxf/classes/Request.d.ts +++ b/dist/vdxf/classes/Request.d.ts @@ -41,4 +41,6 @@ export declare class Request extends VDXFObject { }; }; }; + toWalletDeeplinkUri(): string; + static fromWalletDeeplinkUri(uri: string): Request; } diff --git a/dist/vdxf/classes/Request.js b/dist/vdxf/classes/Request.js index efcfc8c1..ae2c16d8 100644 --- a/dist/vdxf/classes/Request.js +++ b/dist/vdxf/classes/Request.js @@ -4,6 +4,7 @@ exports.Request = void 0; const __1 = require("../"); const keys_1 = require("../keys"); const Challenge_1 = require("./Challenge"); +const base64url_1 = require("base64url"); class Request extends __1.VDXFObject { constructor(request) { super(__1.LOGIN_CONSENT_REQUEST_VDXF_KEY.vdxfid); @@ -26,5 +27,13 @@ class Request extends __1.VDXFObject { challenge: this.challenge.stringable(), }; } + toWalletDeeplinkUri() { + return `${__1.WALLET_VDXF_KEY.vdxfid.toLowerCase()}://x-callback-url/${__1.LOGIN_CONSENT_REQUEST_VDXF_KEY.vdxfid}/?${__1.LOGIN_CONSENT_REQUEST_VDXF_KEY.vdxfid}=${(0, base64url_1.default)(JSON.stringify(this.stringable()))}`; + } + static fromWalletDeeplinkUri(uri) { + const split = uri.split(`${__1.LOGIN_CONSENT_REQUEST_VDXF_KEY.vdxfid}=`); + const stringable = JSON.parse(base64url_1.default.decode(split[1])); + return new Request(stringable); + } } exports.Request = Request; diff --git a/package.json b/package.json index 3e7c476b..2424b570 100644 --- a/package.json +++ b/package.json @@ -7,5 +7,11 @@ "/dist" ], "repository": "https://github.com/VerusCoin/verus-typescript-primitives.git", - "license": "MIT" + "license": "MIT", + "dependencies": { + "base64url": "^3.0.1" + }, + "devDependencies": { + "@types/node": "^18.7.22" + } } diff --git a/src/vdxf/classes/Request.ts b/src/vdxf/classes/Request.ts index fe37e92f..590d4889 100644 --- a/src/vdxf/classes/Request.ts +++ b/src/vdxf/classes/Request.ts @@ -1,6 +1,13 @@ -import { LOGIN_CONSENT_REQUEST_VDXF_KEY, VDXFObject, VerusIDSignature, VerusIDSignatureInterface } from "../"; +import { + LOGIN_CONSENT_REQUEST_VDXF_KEY, + WALLET_VDXF_KEY, + VDXFObject, + VerusIDSignature, + VerusIDSignatureInterface, +} from "../"; import { LOGIN_CONSENT_REQUEST_SIG_VDXF_KEY } from "../keys"; import { Challenge, ChallengeInterface } from "./Challenge"; +import base64url from 'base64url'; export interface RequestInterface { system_id: string; @@ -42,4 +49,19 @@ export class Request extends VDXFObject { challenge: this.challenge.stringable(), }; } + + toWalletDeeplinkUri(): string { + return `${WALLET_VDXF_KEY.vdxfid.toLowerCase()}://x-callback-url/${ + LOGIN_CONSENT_REQUEST_VDXF_KEY.vdxfid + }/?${LOGIN_CONSENT_REQUEST_VDXF_KEY.vdxfid}=${base64url( + JSON.stringify(this.stringable()) + )}`; + } + + static fromWalletDeeplinkUri(uri: string): Request { + const split = uri.split(`${LOGIN_CONSENT_REQUEST_VDXF_KEY.vdxfid}=`); + const stringable = JSON.parse(base64url.decode(split[1])); + + return new Request(stringable) + } } diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 00000000..b5611c1f --- /dev/null +++ b/yarn.lock @@ -0,0 +1,13 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/node@^18.7.22": + version "18.7.22" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.22.tgz#76f7401362ad63d9d7eefa7dcdfa5fcd9baddff3" + integrity sha512-TsmoXYd4zrkkKjJB0URF/mTIKPl+kVcbqClB2F/ykU7vil1BfWZVndOnpEIozPv4fURD28gyPFeIkW2G+KXOvw== + +base64url@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/base64url/-/base64url-3.0.1.tgz#6399d572e2bc3f90a9a8b22d5dbb0a32d33f788d" + integrity sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A== From 2d16540b84187c99067b8142bf6a19e2e224eb86 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Mon, 26 Sep 2022 17:33:28 +0200 Subject: [PATCH 6/6] Make created_at mandatory and salt, context optional for login consent requests --- dist/vdxf/classes/Challenge.d.ts | 12 +++---- dist/vdxf/classes/Decision.d.ts | 2 +- dist/vdxf/keys.js | 48 +++++++++++++-------------- src/vdxf/classes/Challenge.ts | 12 +++---- src/vdxf/classes/Decision.ts | 2 +- src/vdxf/keys.ts | 56 ++++++++++++++++---------------- 6 files changed, 66 insertions(+), 66 deletions(-) diff --git a/dist/vdxf/classes/Challenge.d.ts b/dist/vdxf/classes/Challenge.d.ts index 1ecbf348..875a3a85 100644 --- a/dist/vdxf/classes/Challenge.d.ts +++ b/dist/vdxf/classes/Challenge.d.ts @@ -24,9 +24,9 @@ export interface ChallengeInterface { session_id?: string; attestations?: null; redirect_uris?: Array; - created_at?: string; - salt: string; - context: { + created_at: string; + salt?: string; + context?: { [key: string]: any; }; } @@ -39,9 +39,9 @@ export declare class Challenge extends VDXFObject implements ChallengeInterface session_id?: string; attestations?: null; redirect_uris?: Array; - created_at?: string; - salt: string; - context: { + created_at: string; + salt?: string; + context?: { [key: string]: any; }; constructor(challenge: ChallengeInterface); diff --git a/dist/vdxf/classes/Decision.d.ts b/dist/vdxf/classes/Decision.d.ts index e68c7741..80c2fc24 100644 --- a/dist/vdxf/classes/Decision.d.ts +++ b/dist/vdxf/classes/Decision.d.ts @@ -4,7 +4,7 @@ import { Request, RequestInterface } from "./Request"; export interface DecisionInterface { decision_id: string; request: RequestInterface; - created_at?: string; + created_at: string; context?: { [key: string]: any; }; diff --git a/dist/vdxf/keys.js b/dist/vdxf/keys.js index e8d11e8f..c069682d 100644 --- a/dist/vdxf/keys.js +++ b/dist/vdxf/keys.js @@ -26,12 +26,12 @@ exports.LOGIN_CONSENT_REQUEST_VDXF_KEY = { }, }; exports.LOGIN_CONSENT_OIDC_REQUEST_VDXF_KEY = { - "vdxfid": "i5XKaak5R68S1oW55dDDu7XEkRZpRTFts6", - "hash160result": "e19a485ca8bce6540ace5f40e415a4a7d29a7716", - "qualifiedname": { - "namespace": "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", - "name": "vrsc::system.identity.authentication.loginconsent.oidcrequest" - } + vdxfid: "i5XKaak5R68S1oW55dDDu7XEkRZpRTFts6", + hash160result: "e19a485ca8bce6540ace5f40e415a4a7d29a7716", + qualifiedname: { + namespace: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + name: "vrsc::system.identity.authentication.loginconsent.oidcrequest", + }, }; exports.LOGIN_CONSENT_RESPONSE_VDXF_KEY = { vdxfid: "iJQaibDkoUxwGoE2YhZtVVZyhKxZs1G7uU", @@ -66,12 +66,12 @@ exports.LOGIN_CONSENT_DECISION_VDXF_KEY = { }, }; exports.LOGIN_CONSENT_OIDC_DECISION_VDXF_KEY = { - "vdxfid": "i49KeF2Ucd2NukXTbP2ArHX2JUtfqZRC63", - "hash160result": "890efbba846eac07b3220d197cfe9f2269615607", - "qualifiedname": { - "namespace": "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", - "name": "vrsc::system.identity.authentication.loginconsent.response.oidcdecision" - } + vdxfid: "i49KeF2Ucd2NukXTbP2ArHX2JUtfqZRC63", + hash160result: "890efbba846eac07b3220d197cfe9f2269615607", + qualifiedname: { + namespace: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + name: "vrsc::system.identity.authentication.loginconsent.response.oidcdecision", + }, }; exports.LOGIN_CONSENT_OIDC_CLIENT_VDXF_KEY = { vdxfid: "iGo5omf7RubucEU6nM6THM6bhPgq1SjSqS", @@ -90,18 +90,18 @@ exports.WALLET_VDXF_KEY = { }, }; exports.LOGIN_CONSENT_REDIRECT_VDXF_KEY = { - "vdxfid": "iAPmsGJkkpMN1sCTF59fscV7jD8tv1whnk", - "hash160result": "8109473c99bc48562253bf2ddba2f6bf8cd9e24b", - "qualifiedname": { - "namespace": "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", - "name": "vrsc::system.identity.authentication.loginconsent.redirect" - } + vdxfid: "iAPmsGJkkpMN1sCTF59fscV7jD8tv1whnk", + hash160result: "8109473c99bc48562253bf2ddba2f6bf8cd9e24b", + qualifiedname: { + namespace: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + name: "vrsc::system.identity.authentication.loginconsent.redirect", + }, }; exports.LOGIN_CONSENT_WEBHOOK_VDXF_KEY = { - "vdxfid": "iACPLH19SXKHoRJboWoxZHZRHz791Zii41", - "hash160result": "87b84b3dbfd7948f9156bb8bb81e2ebfab76bb49", - "qualifiedname": { - "namespace": "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", - "name": "vrsc::system.identity.authentication.loginconsent.webhook" - } + vdxfid: "iACPLH19SXKHoRJboWoxZHZRHz791Zii41", + hash160result: "87b84b3dbfd7948f9156bb8bb81e2ebfab76bb49", + qualifiedname: { + namespace: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + name: "vrsc::system.identity.authentication.loginconsent.webhook", + }, }; diff --git a/src/vdxf/classes/Challenge.ts b/src/vdxf/classes/Challenge.ts index f3bda3d4..14635ebd 100644 --- a/src/vdxf/classes/Challenge.ts +++ b/src/vdxf/classes/Challenge.ts @@ -60,13 +60,13 @@ export interface ChallengeInterface { redirect_uris?: Array; // String of unix representation of date string - created_at?: string; + created_at: string; // Random hash string - salt: string; + salt?: string; // Context - context: { [key: string]: any }; + context?: { [key: string]: any }; } export class Challenge extends VDXFObject implements ChallengeInterface { @@ -78,9 +78,9 @@ export class Challenge extends VDXFObject implements ChallengeInterface { session_id?: string; attestations?: null; redirect_uris?: Array; - created_at?: string; - salt: string; - context: { [key: string]: any }; + created_at: string; + salt?: string; + context?: { [key: string]: any }; constructor(challenge: ChallengeInterface) { super(LOGIN_CONSENT_CHALLENGE_VDXF_KEY.vdxfid) diff --git a/src/vdxf/classes/Decision.ts b/src/vdxf/classes/Decision.ts index b4b667b0..0386e860 100644 --- a/src/vdxf/classes/Decision.ts +++ b/src/vdxf/classes/Decision.ts @@ -13,7 +13,7 @@ export interface DecisionInterface { request: RequestInterface; // String of unix representation of date string - created_at?: string; + created_at: string; // General context context?: { [key: string]: any }; diff --git a/src/vdxf/keys.ts b/src/vdxf/keys.ts index 9483e850..f62f44e9 100644 --- a/src/vdxf/keys.ts +++ b/src/vdxf/keys.ts @@ -36,13 +36,13 @@ export const LOGIN_CONSENT_REQUEST_VDXF_KEY: VDXFKeyInterface = { }; export const LOGIN_CONSENT_OIDC_REQUEST_VDXF_KEY: VDXFKeyInterface = { - "vdxfid": "i5XKaak5R68S1oW55dDDu7XEkRZpRTFts6", - "hash160result": "e19a485ca8bce6540ace5f40e415a4a7d29a7716", - "qualifiedname": { - "namespace": "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", - "name": "vrsc::system.identity.authentication.loginconsent.oidcrequest" - } -} + vdxfid: "i5XKaak5R68S1oW55dDDu7XEkRZpRTFts6", + hash160result: "e19a485ca8bce6540ace5f40e415a4a7d29a7716", + qualifiedname: { + namespace: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + name: "vrsc::system.identity.authentication.loginconsent.oidcrequest", + }, +}; export const LOGIN_CONSENT_RESPONSE_VDXF_KEY: VDXFKeyInterface = { vdxfid: "iJQaibDkoUxwGoE2YhZtVVZyhKxZs1G7uU", @@ -81,13 +81,13 @@ export const LOGIN_CONSENT_DECISION_VDXF_KEY: VDXFKeyInterface = { }; export const LOGIN_CONSENT_OIDC_DECISION_VDXF_KEY: VDXFKeyInterface = { - "vdxfid": "i49KeF2Ucd2NukXTbP2ArHX2JUtfqZRC63", - "hash160result": "890efbba846eac07b3220d197cfe9f2269615607", - "qualifiedname": { - "namespace": "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", - "name": "vrsc::system.identity.authentication.loginconsent.response.oidcdecision" - } -} + vdxfid: "i49KeF2Ucd2NukXTbP2ArHX2JUtfqZRC63", + hash160result: "890efbba846eac07b3220d197cfe9f2269615607", + qualifiedname: { + namespace: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + name: "vrsc::system.identity.authentication.loginconsent.response.oidcdecision", + }, +}; export const LOGIN_CONSENT_OIDC_CLIENT_VDXF_KEY: VDXFKeyInterface = { vdxfid: "iGo5omf7RubucEU6nM6THM6bhPgq1SjSqS", @@ -108,19 +108,19 @@ export const WALLET_VDXF_KEY: VDXFKeyInterface = { }; export const LOGIN_CONSENT_REDIRECT_VDXF_KEY: VDXFKeyInterface = { - "vdxfid": "iAPmsGJkkpMN1sCTF59fscV7jD8tv1whnk", - "hash160result": "8109473c99bc48562253bf2ddba2f6bf8cd9e24b", - "qualifiedname": { - "namespace": "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", - "name": "vrsc::system.identity.authentication.loginconsent.redirect" - } -} + vdxfid: "iAPmsGJkkpMN1sCTF59fscV7jD8tv1whnk", + hash160result: "8109473c99bc48562253bf2ddba2f6bf8cd9e24b", + qualifiedname: { + namespace: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + name: "vrsc::system.identity.authentication.loginconsent.redirect", + }, +}; export const LOGIN_CONSENT_WEBHOOK_VDXF_KEY: VDXFKeyInterface = { - "vdxfid": "iACPLH19SXKHoRJboWoxZHZRHz791Zii41", - "hash160result": "87b84b3dbfd7948f9156bb8bb81e2ebfab76bb49", - "qualifiedname": { - "namespace": "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", - "name": "vrsc::system.identity.authentication.loginconsent.webhook" - } -} + vdxfid: "iACPLH19SXKHoRJboWoxZHZRHz791Zii41", + hash160result: "87b84b3dbfd7948f9156bb8bb81e2ebfab76bb49", + qualifiedname: { + namespace: "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV", + name: "vrsc::system.identity.authentication.loginconsent.webhook", + }, +};