Skip to content

Commit

Permalink
refactor!: rotated registration management access tokens by default
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The client registration management update action now rotates registration access tokens by default. This can be reverted using the `features.registrationManagement.rotateRegistrationAccessToken` configuration option.
  • Loading branch information
panva committed Dec 1, 2022
1 parent 059557b commit 2eb5c63
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@ _**default value**_:
```js
{
enabled: false,
rotateRegistrationAccessToken: false
rotateRegistrationAccessToken: true
}
```

Expand All @@ -1547,7 +1547,7 @@ Enables registration access token rotation. The provider will discard the curren

_**default value**_:
```js
false
true
```
<a id="rotate-registration-access-token-function-use"></a><details><summary>(Click to expand) function use
</summary><br>
Expand Down
2 changes: 1 addition & 1 deletion lib/helpers/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@ function getDefaults() {
* }
* ```
*/
rotateRegistrationAccessToken: false,
rotateRegistrationAccessToken: true,
},

/*
Expand Down
1 change: 0 additions & 1 deletion test/client_id_uri/client_id_uri.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const config = cloneDeep(require('../default.config'));
merge(config.features, {
registration: {
enabled: true,
rotateRegistrationAccessToken: false,
idFactory() {
return new URL(`https://repo.clients.com/path?id=${nanoid()}`).href;
},
Expand Down
4 changes: 2 additions & 2 deletions test/client_id_uri/client_id_uri.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('registration management with client_id as URI', () => {
.auth(registration_access_token, { type: 'bearer' })
.expect(200)
.expect((response) => {
({ registration_client_uri } = response.body);
({ registration_access_token, registration_client_uri } = response.body);

const parsed = new URL(registration_client_uri);
expect(parsed.search).to.be.empty;
Expand All @@ -44,7 +44,7 @@ describe('registration management with client_id as URI', () => {
})
.expect(200)
.expect((response) => {
({ registration_client_uri } = response.body);
({ registration_access_token, registration_client_uri } = response.body);

const parsed = new URL(registration_client_uri);
expect(parsed.search).to.be.empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const merge = require('lodash/merge');
const config = cloneDeep(require('../default.config'));

merge(config.features, {
registrationManagement: { enabled: true },
registrationManagement: { enabled: true, rotateRegistrationAccessToken: false },
registration: { enabled: true },
});

Expand Down
2 changes: 1 addition & 1 deletion test/registration_policies/registration_policies.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const merge = require('lodash/merge');
const config = cloneDeep(require('../default.config'));

merge(config.features, {
registrationManagement: { enabled: true },
registrationManagement: { enabled: true, rotateRegistrationAccessToken: false },
registration: {
enabled: true,
initialAccessToken: true,
Expand Down

0 comments on commit 2eb5c63

Please sign in to comment.