Merge pull request #2863 from SDA-SE/feat/default-scope-auth-providers
feat: configurable default scopes of auth providers
This commit is contained in:
@@ -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 };
|
||||
};
|
||||
```
|
||||
Reference in New Issue
Block a user