Skip to content

Commit 6137d3c

Browse files
committed
adjust for tests
1 parent f24d6b0 commit 6137d3c

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/converter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export class Converter {
8484
this.allOfTransform = Boolean(options?.allOfTransform);
8585
this.authorizationUrl = options?.authorizationUrl || 'https://www.example.com/oauth2/authorize';
8686
this.tokenUrl = options?.tokenUrl || 'https://www.example.com/oauth2/token';
87-
this.convertOpenIdConnectToOAuth2 = options.convertOpenIdConnectToOAuth2;
87+
this.convertOpenIdConnectToOAuth2 = options?.convertOpenIdConnectToOAuth2 || !!(options?.scopeDescriptionFile);
8888
if (this.convertOpenIdConnectToOAuth2) {
8989
this.loadScopeDescriptions(options.scopeDescriptionFile);
9090
}
@@ -404,7 +404,7 @@ export class Converter {
404404
const requirement = s?.[schemeName] as string[];
405405
if (requirement) {
406406
requirement.forEach((scope) => {
407-
scopes[scope] = this.scopeDescriptions.scopes[scope].description || `TODO: describe the ${scope} scope`;
407+
scopes[scope] = this.scopeDescriptions[scope] || `TODO: describe the '${scope}' scope`;
408408
});
409409
}
410410
});

test/converter.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ describe('resolver test suite', () => {
134134
authorizationUrl: 'https://www.example.com/test/authorize',
135135
tokenUrl: 'https://www.example.com/test/token',
136136
scopeDescriptionFile: path.join(__dirname, 'data/scopes.yaml'),
137+
convertOpenIdConnectToOAuth2: true
137138
};
138139
const converter = new Converter(input, options);
139140
const converted: any = converter.convert();

0 commit comments

Comments
 (0)