Merge pull request #2863 from SDA-SE/feat/default-scope-auth-providers

feat: configurable default scopes of auth providers
This commit is contained in:
Patrik Oldsberg
2020-11-05 10:53:43 +01:00
committed by GitHub
10 changed files with 95 additions and 123 deletions
+29
View File
@@ -0,0 +1,29 @@
---
'@backstage/core-api': patch
---
Updated the AuthApi `.create` methods to configure the default scope of the corresponding Auth Api. As a result the
default scope is configurable when overwriting the Core Api in the app.
```
GithubAuth.create({
discoveryApi,
oauthRequestApi,
defaultScopes: ['read:user', 'repo'],
}),
```
Replaced redundant CreateOptions of each Auth Api with the OAuthApiCreateOptions type.
```
export type OAuthApiCreateOptions = AuthApiCreateOptions & {
oauthRequestApi: OAuthRequestApi;
defaultScopes?: string[];
};
export type AuthApiCreateOptions = {
discoveryApi: DiscoveryApi;
environment?: string;
provider?: AuthProvider & { id: string };
};
```