Skip to content

Commit

Permalink
refactor: OIDCContext and Interaction property signed renamed
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `OIDCContext` and `Interaction` instance property
`signed` renamed to `trusted`.
  • Loading branch information
panva committed Mar 3, 2020
1 parent 2c3a667 commit 0ed56bd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion example/my_adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class MyAdapter {
* - returnTo {string} - after resolving interactions send the user-agent to this url
* - params {object} - parsed recognized parameters object
* - lastSubmission {object} - previous interaction result submission
* - signed {string[]} - parameter names that come from a trusted source
* - trusted {string[]} - parameter names that come from a trusted source
* - result {object} - interaction results object is expected here
* - session {object}
* - session.uid {string} - uid of the session this Interaction belongs to
Expand Down
2 changes: 1 addition & 1 deletion lib/actions/authorization/interactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ module.exports = async function interactions(resumeRouteName, ctx, next) {
accountId: oidc.session.accountId(),
uid: oidc.uid,
params: oidc.params.toPlainObject(),
signed: oidc.signed,
trusted: oidc.trusted,
session: oidc.session,
});

Expand Down
2 changes: 1 addition & 1 deletion lib/actions/authorization/process_request_object.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ module.exports = async function processRequestObject(PARAM_LIST, rejectDupesMidd
}

if (trusted || (pushedRequestObject && client.tokenEndpointAuthMethod !== 'none')) {
ctx.oidc.signed = Object.keys(request); // TODO: in v7.x rename to "trusted"
ctx.oidc.trusted = Object.keys(request);
} else if (ctx.oidc.insecureRequestUri) {
throw new InvalidRequestObject('Request Object from insecure request_uri must be signed and/or symmetrically encrypted');
}
Expand Down
4 changes: 2 additions & 2 deletions lib/actions/authorization/resume.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = async function resumeAction(whitelist, resumeRouteName, ctx, ne
const {
result,
params: storedParams = {},
signed = [],
trusted = [],
session: originSession,
} = interactionSession;

Expand Down Expand Up @@ -72,7 +72,7 @@ module.exports = async function resumeAction(whitelist, resumeRouteName, ctx, ne

const params = new (Params(whitelist))(storedParams);
ctx.oidc.params = params;
ctx.oidc.signed = signed;
ctx.oidc.trusted = trusted;
ctx.oidc.redirectUriCheckPerformed = true;

const clearOpts = {
Expand Down
6 changes: 3 additions & 3 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ declare class Interaction extends BaseModel {
prompt: PromptDetail;
result?: InteractionResults;
returnTo: string;
signed?: string[];
trusted?: string[];
uid: string;
lastSubmission?: InteractionResults;

Expand Down Expand Up @@ -692,7 +692,7 @@ declare class OIDCContext {

readonly webMessageUriCheckPerformed?: boolean;
readonly redirectUriCheckPerformed?: boolean;
readonly signed?: string[];
readonly trusted?: string[];
readonly registrationAccessToken?: RegistrationAccessToken;
readonly deviceCode?: DeviceCode;
readonly accessToken?: AccessToken;
Expand Down Expand Up @@ -794,7 +794,7 @@ export interface AdapterPayload extends AnyClientMetadata {
};
sessionUid?: string;
sid?: string;
signed?: string[];
trusted?: string[];
state?: AnyObject;
transient?: boolean;
uid?: string;
Expand Down

0 comments on commit 0ed56bd

Please sign in to comment.