Skip to content

Commit

Permalink
refactor: remove few deprecated configuration properties
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The deprecated `postLogoutSuccessSource` configuration
property was removed, use
`features.rpInitiatedLogout.postLogoutSuccessSource` instead.

BREAKING CHANGE: The deprecated `logoutSource` configuration
property was removed, use
`features.rpInitiatedLogout.logoutSource` instead.
  • Loading branch information
panva committed Aug 14, 2020
1 parent 8f10e56 commit 1767c8f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 29 deletions.
15 changes: 0 additions & 15 deletions lib/helpers/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class Configuration {
this.collectGrantTypes();
this.checkSubjectTypes();
this.checkPkceMethods();
this.checkRpInitiatedLogoutHelpers();
this.checkDependantFeatures();
this.checkDeviceFlow();
this.checkAuthMethods();
Expand Down Expand Up @@ -341,20 +340,6 @@ class Configuration {
});
}

checkRpInitiatedLogoutHelpers() {
if (this.postLogoutSuccessSource) {
this.postLogoutSuccessSourceDeprecationNotice();
this.features.rpInitiatedLogout.postLogoutSuccessSource = this.postLogoutSuccessSource;
delete this.postLogoutSuccessSource;
}

if (this.logoutSource) {
this.logoutSourceDeprecationNotice();
this.features.rpInitiatedLogout.logoutSource = this.logoutSource;
delete this.logoutSource;
}
}

checkPkceMethods() {
if (!Array.isArray(this.pkce.methods)) {
throw new TypeError('pkce.methods must be an array');
Expand Down
3 changes: 0 additions & 3 deletions lib/helpers/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -2657,9 +2657,6 @@ function getDefaults() {
'RS256', 'PS256', 'ES256', 'EdDSA',
],
},

postLogoutSuccessSource: undefined,
logoutSource: undefined,
};

/*
Expand Down
4 changes: 0 additions & 4 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1038,12 +1038,8 @@ export interface Configuration {
validator?: (ctx: KoaContextWithOIDC, key: string, value: any, metadata: ClientMetadata) => void | undefined;
};

postLogoutSuccessSource?: (ctx: KoaContextWithOIDC) => CanBePromise<void | undefined>;

rotateRefreshToken?: ((ctx: KoaContextWithOIDC) => CanBePromise<boolean>) | boolean;

logoutSource?: (ctx: KoaContextWithOIDC, form: string) => CanBePromise<void | undefined>;

renderError?: (ctx: KoaContextWithOIDC, out: ErrorOut, error: errors.OIDCProviderError | Error) => CanBePromise<void | undefined>;

interactions?: {
Expand Down
17 changes: 10 additions & 7 deletions types/oidc-provider-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,6 @@ const provider = new Provider('https://op.example.com', {
metadata.foo = 'bar';
}
},
async postLogoutSuccessSource(ctx) {
ctx.oidc.issuer.substring(0);
},
interactions: {
async url(ctx, interaction) {
ctx.oidc.issuer.substring(0);
Expand Down Expand Up @@ -322,10 +319,6 @@ const provider = new Provider('https://op.example.com', {
use.substring(0);
return 'foo';
},
async logoutSource(ctx, form) {
ctx.oidc.issuer.substring(0);
form.substring(0);
},
async renderError(ctx, out, err) {
ctx.oidc.issuer.substring(0);
out.error.substring(0);
Expand All @@ -350,6 +343,16 @@ const provider = new Provider('https://op.example.com', {
},
},
userinfo: { enabled: false },
rpInitiatedLogout: {
enabled: false,
async postLogoutSuccessSource(ctx) {
ctx.oidc.issuer.substring(0);
},
async logoutSource(ctx, form) {
ctx.oidc.issuer.substring(0);
form.substring(0);
},
},
jwtUserinfo: { enabled: false },
webMessageResponseMode: { enabled: false, ack: 'id-00', scriptNonce() { return "foo"; } },
revocation: { enabled: false },
Expand Down

0 comments on commit 1767c8f

Please sign in to comment.