@backstage/integration-react 0.1.10 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +124 -0
- package/dist/index.d.ts +223 -5
- package/dist/index.esm.js +124 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,129 @@
|
|
|
1
1
|
# @backstage/integration-react
|
|
2
2
|
|
|
3
|
+
## 0.1.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/core-components@0.7.4
|
|
9
|
+
- @backstage/core-plugin-api@0.2.0
|
|
10
|
+
|
|
11
|
+
## 0.1.13
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 36e2b548cb: Clean up the API exports
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @backstage/config@0.1.11
|
|
18
|
+
- @backstage/theme@0.2.12
|
|
19
|
+
- @backstage/integration@0.6.9
|
|
20
|
+
- @backstage/core-components@0.7.2
|
|
21
|
+
- @backstage/core-plugin-api@0.1.12
|
|
22
|
+
|
|
23
|
+
## 0.1.12
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
- @backstage/integration@0.6.8
|
|
29
|
+
- @backstage/core-components@0.7.0
|
|
30
|
+
- @backstage/theme@0.2.11
|
|
31
|
+
|
|
32
|
+
## 0.1.11
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- 18148f23da: Added `ScmAuthApi` along with the implementation `ScmAuth`. The `ScmAuthApi` provides methods for client-side authentication towards multiple different source code management services simultaneously.
|
|
37
|
+
|
|
38
|
+
When requesting credentials you supply a URL along with the same options as the other `OAuthApi`s, and optionally a request for additional high-level scopes.
|
|
39
|
+
|
|
40
|
+
For example like this:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
const { token } = await scmAuthApi.getCredentials({
|
|
44
|
+
url: 'https://ghe.example.com/backstage/backstage',
|
|
45
|
+
additionalScope: {
|
|
46
|
+
repoWrite: true,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The instantiation of the API can either be done with a default factory that adds support for the public providers (github.com, gitlab.com, etc.):
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
// in packages/app/apis.ts
|
|
55
|
+
ScmAuth.createDefaultApiFactory();
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Or with a more custom setup that can add support for additional providers, for example like this:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
createApiFactory({
|
|
62
|
+
api: scmAuthApiRef,
|
|
63
|
+
deps: {
|
|
64
|
+
gheAuthApi: gheAuthApiRef,
|
|
65
|
+
githubAuthApi: githubAuthApiRef,
|
|
66
|
+
},
|
|
67
|
+
factory: ({ githubAuthApi, gheAuthApi }) =>
|
|
68
|
+
ScmAuth.merge(
|
|
69
|
+
ScmAuth.forGithub(githubAuthApi),
|
|
70
|
+
ScmAuth.forGithub(gheAuthApi, {
|
|
71
|
+
host: 'ghe.example.com',
|
|
72
|
+
}),
|
|
73
|
+
),
|
|
74
|
+
});
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The additional `gheAuthApiRef` utility API can be defined either inside the app itself if it's only used for this purpose, or inside an internal common package for APIs, such as `@internal/apis`:
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
const gheAuthApiRef: ApiRef<OAuthApi & ProfileInfoApi & SessionApi> =
|
|
81
|
+
createApiRef({
|
|
82
|
+
id: 'internal.auth.ghe',
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
And then implemented using the `GithubAuth` class from `@backstage/core-app-api`:
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
createApiFactory({
|
|
90
|
+
api: gheAuthApiRef,
|
|
91
|
+
deps: {
|
|
92
|
+
discoveryApi: discoveryApiRef,
|
|
93
|
+
oauthRequestApi: oauthRequestApiRef,
|
|
94
|
+
configApi: configApiRef,
|
|
95
|
+
},
|
|
96
|
+
factory: ({ discoveryApi, oauthRequestApi, configApi }) =>
|
|
97
|
+
GithubAuth.create({
|
|
98
|
+
provider: {
|
|
99
|
+
id: 'ghe',
|
|
100
|
+
icon: ...,
|
|
101
|
+
title: 'GHE'
|
|
102
|
+
},
|
|
103
|
+
discoveryApi,
|
|
104
|
+
oauthRequestApi,
|
|
105
|
+
defaultScopes: ['read:user'],
|
|
106
|
+
environment: configApi.getOptionalString('auth.environment'),
|
|
107
|
+
}),
|
|
108
|
+
})
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Finally you also need to add and configure another GitHub provider to the `auth-backend` using the provider ID `ghe`:
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
// Add the following options to `createRouter` in packages/backend/src/plugins/auth.ts
|
|
115
|
+
providerFactories: {
|
|
116
|
+
ghe: createGithubProvider(),
|
|
117
|
+
},
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Other providers follow the same steps, but you will want to use the appropriate auth API implementation in the frontend, such as for example `GitlabAuth`.
|
|
121
|
+
|
|
122
|
+
- Updated dependencies
|
|
123
|
+
- @backstage/integration@0.6.6
|
|
124
|
+
- @backstage/core-plugin-api@0.1.9
|
|
125
|
+
- @backstage/core-components@0.6.0
|
|
126
|
+
|
|
3
127
|
## 0.1.10
|
|
4
128
|
|
|
5
129
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,233 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
3
|
+
import { AuthRequestOptions, ApiRef, OAuthApi } from '@backstage/core-plugin-api';
|
|
2
4
|
import { Config } from '@backstage/config';
|
|
3
5
|
import { ScmIntegrationRegistry } from '@backstage/integration';
|
|
4
|
-
import { ApiRef } from '@backstage/core-plugin-api';
|
|
5
6
|
|
|
7
|
+
/**
|
|
8
|
+
* The options that control a {@link ScmAuthApi.getCredentials} call.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
interface ScmAuthTokenOptions extends AuthRequestOptions {
|
|
13
|
+
/**
|
|
14
|
+
* The URL of the SCM resource to be accessed.
|
|
15
|
+
*
|
|
16
|
+
* @example https://github.com/backstage/backstage
|
|
17
|
+
*/
|
|
18
|
+
url: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether to request additional access scope.
|
|
21
|
+
*
|
|
22
|
+
* Read access to user, organization, and repositories is always included.
|
|
23
|
+
*/
|
|
24
|
+
additionalScope?: {
|
|
25
|
+
/**
|
|
26
|
+
* Requests access to be able to write repository content, including
|
|
27
|
+
* the ability to create things like issues and pull requests.
|
|
28
|
+
*/
|
|
29
|
+
repoWrite?: boolean;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The response from a {@link ScmAuthApi.getCredentials} call.
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
interface ScmAuthTokenResponse {
|
|
38
|
+
/**
|
|
39
|
+
* An authorization token that can be used to authenticate requests.
|
|
40
|
+
*/
|
|
41
|
+
token: string;
|
|
42
|
+
/**
|
|
43
|
+
* The set of HTTP headers that are needed to authenticate requests.
|
|
44
|
+
*/
|
|
45
|
+
headers: {
|
|
46
|
+
[name: string]: string;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* ScmAuthApi provides methods for authenticating towards source code management services.
|
|
51
|
+
*
|
|
52
|
+
* As opposed to using the GitHub, GitLab and other auth APIs
|
|
53
|
+
* directly, this API allows for more generic access to SCM services.
|
|
54
|
+
*
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
57
|
+
interface ScmAuthApi {
|
|
58
|
+
/**
|
|
59
|
+
* Requests credentials for accessing an SCM resource.
|
|
60
|
+
*/
|
|
61
|
+
getCredentials(options: ScmAuthTokenOptions): Promise<ScmAuthTokenResponse>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The ApiRef for the ScmAuthApi.
|
|
65
|
+
*
|
|
66
|
+
* @public
|
|
67
|
+
*/
|
|
68
|
+
declare const scmAuthApiRef: ApiRef<ScmAuthApi>;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* An implementation of the ScmAuthApi that merges together OAuthApi instances
|
|
72
|
+
* to form a single instance that can handles authentication for multiple providers.
|
|
73
|
+
*
|
|
74
|
+
* @public
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```
|
|
78
|
+
* // Supports authentication towards both public GitHub and GHE:
|
|
79
|
+
* createApiFactory({
|
|
80
|
+
* api: scmAuthApiRef,
|
|
81
|
+
* deps: {
|
|
82
|
+
* gheAuthApi: gheAuthApiRef,
|
|
83
|
+
* githubAuthApi: githubAuthApiRef,
|
|
84
|
+
* },
|
|
85
|
+
* factory: ({ githubAuthApi, gheAuthApi }) =>
|
|
86
|
+
* ScmAuth.merge(
|
|
87
|
+
* ScmAuth.forGithub(githubAuthApi),
|
|
88
|
+
* ScmAuth.forGithub(gheAuthApi, {
|
|
89
|
+
* host: 'ghe.example.com',
|
|
90
|
+
* }),
|
|
91
|
+
* )
|
|
92
|
+
* })
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
declare class ScmAuth implements ScmAuthApi {
|
|
96
|
+
#private;
|
|
97
|
+
/**
|
|
98
|
+
* Creates an API factory that enables auth for each of the default SCM providers.
|
|
99
|
+
*/
|
|
100
|
+
static createDefaultApiFactory(): _backstage_core_plugin_api.ApiFactory<ScmAuthApi, ScmAuthApi, {
|
|
101
|
+
github: OAuthApi & _backstage_core_plugin_api.ProfileInfoApi & _backstage_core_plugin_api.BackstageIdentityApi & _backstage_core_plugin_api.SessionApi;
|
|
102
|
+
gitlab: OAuthApi & _backstage_core_plugin_api.ProfileInfoApi & _backstage_core_plugin_api.BackstageIdentityApi & _backstage_core_plugin_api.SessionApi;
|
|
103
|
+
azure: OAuthApi & _backstage_core_plugin_api.OpenIdConnectApi & _backstage_core_plugin_api.ProfileInfoApi & _backstage_core_plugin_api.BackstageIdentityApi & _backstage_core_plugin_api.SessionApi;
|
|
104
|
+
}>;
|
|
105
|
+
/**
|
|
106
|
+
* Creates a general purpose ScmAuth instance with a custom scope mapping.
|
|
107
|
+
*/
|
|
108
|
+
static forAuthApi(authApi: OAuthApi, options: {
|
|
109
|
+
host: string;
|
|
110
|
+
scopeMapping: {
|
|
111
|
+
default: string[];
|
|
112
|
+
repoWrite: string[];
|
|
113
|
+
};
|
|
114
|
+
}): ScmAuth;
|
|
115
|
+
/**
|
|
116
|
+
* Creates a new ScmAuth instance that handles authentication towards GitHub.
|
|
117
|
+
*
|
|
118
|
+
* The host option determines which URLs that are handled by this instance and defaults to `github.com`.
|
|
119
|
+
*
|
|
120
|
+
* The default scopes are:
|
|
121
|
+
*
|
|
122
|
+
* `repo read:org read:user`
|
|
123
|
+
*
|
|
124
|
+
* If the additional `repoWrite` permission is requested, these scopes are added:
|
|
125
|
+
*
|
|
126
|
+
* `gist`
|
|
127
|
+
*/
|
|
128
|
+
static forGithub(githubAuthApi: OAuthApi, options?: {
|
|
129
|
+
host?: string;
|
|
130
|
+
}): ScmAuth;
|
|
131
|
+
/**
|
|
132
|
+
* Creates a new ScmAuth instance that handles authentication towards GitLab.
|
|
133
|
+
*
|
|
134
|
+
* The host option determines which URLs that are handled by this instance and defaults to `gitlab.com`.
|
|
135
|
+
*
|
|
136
|
+
* The default scopes are:
|
|
137
|
+
*
|
|
138
|
+
* `read_user read_api read_repository`
|
|
139
|
+
*
|
|
140
|
+
* If the additional `repoWrite` permission is requested, these scopes are added:
|
|
141
|
+
*
|
|
142
|
+
* `write_repository api`
|
|
143
|
+
*/
|
|
144
|
+
static forGitlab(gitlabAuthApi: OAuthApi, options?: {
|
|
145
|
+
host?: string;
|
|
146
|
+
}): ScmAuth;
|
|
147
|
+
/**
|
|
148
|
+
* Creates a new ScmAuth instance that handles authentication towards Azure.
|
|
149
|
+
*
|
|
150
|
+
* The host option determines which URLs that are handled by this instance and defaults to `dev.azure.com`.
|
|
151
|
+
*
|
|
152
|
+
* The default scopes are:
|
|
153
|
+
*
|
|
154
|
+
* `vso.build vso.code vso.graph vso.project vso.profile`
|
|
155
|
+
*
|
|
156
|
+
* If the additional `repoWrite` permission is requested, these scopes are added:
|
|
157
|
+
*
|
|
158
|
+
* `vso.code_manage`
|
|
159
|
+
*/
|
|
160
|
+
static forAzure(microsoftAuthApi: OAuthApi, options?: {
|
|
161
|
+
host?: string;
|
|
162
|
+
}): ScmAuth;
|
|
163
|
+
/**
|
|
164
|
+
* Creates a new ScmAuth instance that handles authentication towards Bitbucket.
|
|
165
|
+
*
|
|
166
|
+
* The host option determines which URLs that are handled by this instance and defaults to `bitbucket.org`.
|
|
167
|
+
*
|
|
168
|
+
* The default scopes are:
|
|
169
|
+
*
|
|
170
|
+
* `account team pullrequest snippet issue`
|
|
171
|
+
*
|
|
172
|
+
* If the additional `repoWrite` permission is requested, these scopes are added:
|
|
173
|
+
*
|
|
174
|
+
* `pullrequest:write snippet:write issue:write`
|
|
175
|
+
*/
|
|
176
|
+
static forBitbucket(bitbucketAuthApi: OAuthApi, options?: {
|
|
177
|
+
host?: string;
|
|
178
|
+
}): ScmAuth;
|
|
179
|
+
/**
|
|
180
|
+
* Merges together multiple ScmAuth instances into one that
|
|
181
|
+
* routes requests to the correct instance based on the URL.
|
|
182
|
+
*/
|
|
183
|
+
static merge(...providers: ScmAuth[]): ScmAuthApi;
|
|
184
|
+
private constructor();
|
|
185
|
+
/**
|
|
186
|
+
* Checks whether the implementation is able to provide authentication for the given URL.
|
|
187
|
+
*/
|
|
188
|
+
isUrlSupported(url: URL): boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Fetches credentials for the given resource.
|
|
191
|
+
*/
|
|
192
|
+
getCredentials(options: ScmAuthTokenOptions): Promise<ScmAuthTokenResponse>;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Factory class for creating {@link @backstage/integration#ScmIntegrationRegistry} instances.
|
|
197
|
+
*
|
|
198
|
+
* @public
|
|
199
|
+
*/
|
|
6
200
|
declare class ScmIntegrationsApi {
|
|
201
|
+
/**
|
|
202
|
+
* Instantiates an {@link @backstage/integration#ScmIntegrationRegistry}.
|
|
203
|
+
*
|
|
204
|
+
* @param config - The root of the config hierarchy.
|
|
205
|
+
*/
|
|
7
206
|
static fromConfig(config: Config): ScmIntegrationRegistry;
|
|
8
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* The API that holds all configured SCM integrations.
|
|
210
|
+
*
|
|
211
|
+
* @public
|
|
212
|
+
*/
|
|
9
213
|
declare const scmIntegrationsApiRef: ApiRef<ScmIntegrationRegistry>;
|
|
10
214
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
215
|
+
/**
|
|
216
|
+
* Props for {@link ScmIntegrationIcon}.
|
|
217
|
+
*
|
|
218
|
+
* @public
|
|
219
|
+
*/
|
|
220
|
+
declare type ScmIntegrationIconProps = {
|
|
221
|
+
/**
|
|
222
|
+
* The integration type, e.g. "github".
|
|
223
|
+
*/
|
|
224
|
+
type?: string;
|
|
225
|
+
};
|
|
226
|
+
/**
|
|
227
|
+
* An icon that represents a certain SCM integration.
|
|
228
|
+
*
|
|
229
|
+
* @public
|
|
230
|
+
*/
|
|
231
|
+
declare const ScmIntegrationIcon: (props: ScmIntegrationIconProps) => JSX.Element;
|
|
14
232
|
|
|
15
|
-
export { ScmIntegrationIcon, ScmIntegrationsApi, scmIntegrationsApiRef };
|
|
233
|
+
export { ScmAuth, ScmAuthApi, ScmAuthTokenOptions, ScmAuthTokenResponse, ScmIntegrationIcon, ScmIntegrationIconProps, ScmIntegrationsApi, scmAuthApiRef, scmIntegrationsApiRef };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,8 +1,128 @@
|
|
|
1
|
+
import { createApiRef, createApiFactory, githubAuthApiRef, gitlabAuthApiRef, microsoftAuthApiRef, useApp } from '@backstage/core-plugin-api';
|
|
1
2
|
import { ScmIntegrations } from '@backstage/integration';
|
|
2
|
-
import { createApiRef, useApp } from '@backstage/core-plugin-api';
|
|
3
3
|
import CodeIcon from '@material-ui/icons/Code';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
|
+
const scmAuthApiRef = createApiRef({
|
|
7
|
+
id: "core.scmauth"
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
var __accessCheck = (obj, member, msg) => {
|
|
11
|
+
if (!member.has(obj))
|
|
12
|
+
throw TypeError("Cannot " + msg);
|
|
13
|
+
};
|
|
14
|
+
var __privateGet = (obj, member, getter) => {
|
|
15
|
+
__accessCheck(obj, member, "read from private field");
|
|
16
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
17
|
+
};
|
|
18
|
+
var __privateSet = (obj, member, value, setter) => {
|
|
19
|
+
__accessCheck(obj, member, "write to private field");
|
|
20
|
+
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
var _providers, _api, _host, _scopeMapping;
|
|
24
|
+
class ScmAuthMux {
|
|
25
|
+
constructor(providers) {
|
|
26
|
+
_providers.set(this, void 0);
|
|
27
|
+
__privateSet(this, _providers, providers);
|
|
28
|
+
}
|
|
29
|
+
async getCredentials(options) {
|
|
30
|
+
const url = new URL(options.url);
|
|
31
|
+
const provider = __privateGet(this, _providers).find((p) => p.isUrlSupported(url));
|
|
32
|
+
if (!provider) {
|
|
33
|
+
throw new Error(`No authentication provider available for access to '${options.url}'`);
|
|
34
|
+
}
|
|
35
|
+
return provider.getCredentials(options);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
_providers = new WeakMap();
|
|
39
|
+
const _ScmAuth = class {
|
|
40
|
+
constructor(api, host, scopeMapping) {
|
|
41
|
+
_api.set(this, void 0);
|
|
42
|
+
_host.set(this, void 0);
|
|
43
|
+
_scopeMapping.set(this, void 0);
|
|
44
|
+
__privateSet(this, _api, api);
|
|
45
|
+
__privateSet(this, _host, host);
|
|
46
|
+
__privateSet(this, _scopeMapping, scopeMapping);
|
|
47
|
+
}
|
|
48
|
+
static createDefaultApiFactory() {
|
|
49
|
+
return createApiFactory({
|
|
50
|
+
api: scmAuthApiRef,
|
|
51
|
+
deps: {
|
|
52
|
+
github: githubAuthApiRef,
|
|
53
|
+
gitlab: gitlabAuthApiRef,
|
|
54
|
+
azure: microsoftAuthApiRef
|
|
55
|
+
},
|
|
56
|
+
factory: ({github, gitlab, azure}) => _ScmAuth.merge(_ScmAuth.forGithub(github), _ScmAuth.forGitlab(gitlab), _ScmAuth.forAzure(azure))
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
static forAuthApi(authApi, options) {
|
|
60
|
+
return new _ScmAuth(authApi, options.host, options.scopeMapping);
|
|
61
|
+
}
|
|
62
|
+
static forGithub(githubAuthApi, options) {
|
|
63
|
+
var _a;
|
|
64
|
+
const host = (_a = options == null ? void 0 : options.host) != null ? _a : "github.com";
|
|
65
|
+
return new _ScmAuth(githubAuthApi, host, {
|
|
66
|
+
default: ["repo", "read:org", "read:user"],
|
|
67
|
+
repoWrite: ["gist"]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
static forGitlab(gitlabAuthApi, options) {
|
|
71
|
+
var _a;
|
|
72
|
+
const host = (_a = options == null ? void 0 : options.host) != null ? _a : "gitlab.com";
|
|
73
|
+
return new _ScmAuth(gitlabAuthApi, host, {
|
|
74
|
+
default: ["read_user", "read_api", "read_repository"],
|
|
75
|
+
repoWrite: ["write_repository", "api"]
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
static forAzure(microsoftAuthApi, options) {
|
|
79
|
+
var _a;
|
|
80
|
+
const host = (_a = options == null ? void 0 : options.host) != null ? _a : "dev.azure.com";
|
|
81
|
+
return new _ScmAuth(microsoftAuthApi, host, {
|
|
82
|
+
default: [
|
|
83
|
+
"vso.build",
|
|
84
|
+
"vso.code",
|
|
85
|
+
"vso.graph",
|
|
86
|
+
"vso.project",
|
|
87
|
+
"vso.profile"
|
|
88
|
+
],
|
|
89
|
+
repoWrite: ["vso.code_manage"]
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
static forBitbucket(bitbucketAuthApi, options) {
|
|
93
|
+
var _a;
|
|
94
|
+
const host = (_a = options == null ? void 0 : options.host) != null ? _a : "bitbucket.org";
|
|
95
|
+
return new _ScmAuth(bitbucketAuthApi, host, {
|
|
96
|
+
default: ["account", "team", "pullrequest", "snippet", "issue"],
|
|
97
|
+
repoWrite: ["pullrequest:write", "snippet:write", "issue:write"]
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
static merge(...providers) {
|
|
101
|
+
return new ScmAuthMux(providers);
|
|
102
|
+
}
|
|
103
|
+
isUrlSupported(url) {
|
|
104
|
+
return url.host === __privateGet(this, _host);
|
|
105
|
+
}
|
|
106
|
+
async getCredentials(options) {
|
|
107
|
+
const {url, additionalScope, ...restOptions} = options;
|
|
108
|
+
const scopes = __privateGet(this, _scopeMapping).default.slice();
|
|
109
|
+
if (additionalScope == null ? void 0 : additionalScope.repoWrite) {
|
|
110
|
+
scopes.push(...__privateGet(this, _scopeMapping).repoWrite);
|
|
111
|
+
}
|
|
112
|
+
const token = await __privateGet(this, _api).getAccessToken(scopes, restOptions);
|
|
113
|
+
return {
|
|
114
|
+
token,
|
|
115
|
+
headers: {
|
|
116
|
+
Authorization: `Bearer ${token}`
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
let ScmAuth = _ScmAuth;
|
|
122
|
+
_api = new WeakMap();
|
|
123
|
+
_host = new WeakMap();
|
|
124
|
+
_scopeMapping = new WeakMap();
|
|
125
|
+
|
|
6
126
|
class ScmIntegrationsApi {
|
|
7
127
|
static fromConfig(config) {
|
|
8
128
|
return ScmIntegrations.fromConfig(config);
|
|
@@ -13,13 +133,14 @@ const scmIntegrationsApiRef = createApiRef({
|
|
|
13
133
|
description: "All of the registered SCM integrations of your config"
|
|
14
134
|
});
|
|
15
135
|
|
|
16
|
-
const ScmIntegrationIcon = (
|
|
136
|
+
const ScmIntegrationIcon = (props) => {
|
|
17
137
|
var _a;
|
|
138
|
+
const {type} = props;
|
|
18
139
|
const app = useApp();
|
|
19
140
|
const DefaultIcon = CodeIcon;
|
|
20
141
|
const Icon = type ? (_a = app.getSystemIcon(type)) != null ? _a : DefaultIcon : DefaultIcon;
|
|
21
142
|
return /* @__PURE__ */ React.createElement(Icon, null);
|
|
22
143
|
};
|
|
23
144
|
|
|
24
|
-
export { ScmIntegrationIcon, ScmIntegrationsApi, scmIntegrationsApiRef };
|
|
145
|
+
export { ScmAuth, ScmIntegrationIcon, ScmIntegrationsApi, scmAuthApiRef, scmIntegrationsApiRef };
|
|
25
146
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/api/ScmIntegrationsApi.ts","../src/components/ScmIntegrationIcon/ScmIntegrationIcon.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Config } from '@backstage/config';\nimport {\n ScmIntegrationRegistry,\n ScmIntegrations,\n} from '@backstage/integration';\nimport { ApiRef, createApiRef } from '@backstage/core-plugin-api';\n\nexport class ScmIntegrationsApi {\n static fromConfig(config: Config): ScmIntegrationRegistry {\n return ScmIntegrations.fromConfig(config);\n }\n}\n\nexport const scmIntegrationsApiRef: ApiRef<ScmIntegrationRegistry> =\n createApiRef({\n id: 'integration.scmintegrations',\n description: 'All of the registered SCM integrations of your config',\n });\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport CodeIcon from '@material-ui/icons/Code';\nimport React from 'react';\nimport { useApp } from '@backstage/core-plugin-api';\n\nexport const ScmIntegrationIcon = ({ type }: { type?: string }) => {\n const app = useApp();\n const DefaultIcon = CodeIcon;\n const Icon = type ? app.getSystemIcon(type) ?? DefaultIcon : DefaultIcon;\n return <Icon />;\n};\n"],"names":[],"mappings":";;;;;yBAuBgC;AAAA,SACvB,WAAW,QAAwC;AACxD,WAAO,gBAAgB,WAAW;AAAA;AAAA;MAIzB,wBACX,aAAa;AAAA,EACX,IAAI;AAAA,EACJ,aAAa;AAAA;;MCbJ,qBAAqB,CAAC,CAAE,UAA8B;AAnBnE;AAoBE,QAAM,MAAM;AACZ,QAAM,cAAc;AACpB,QAAM,OAAO,OAAO,UAAI,cAAc,UAAlB,YAA2B,cAAc;AAC7D,6CAAQ,MAAD;AAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/api/ScmAuthApi.ts","../src/api/ScmAuth.ts","../src/api/ScmIntegrationsApi.ts","../src/components/ScmIntegrationIcon/ScmIntegrationIcon.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ApiRef,\n createApiRef,\n AuthRequestOptions,\n} from '@backstage/core-plugin-api';\n\n/**\n * The options that control a {@link ScmAuthApi.getCredentials} call.\n *\n * @public\n */\nexport interface ScmAuthTokenOptions extends AuthRequestOptions {\n /**\n * The URL of the SCM resource to be accessed.\n *\n * @example https://github.com/backstage/backstage\n */\n url: string;\n\n /**\n * Whether to request additional access scope.\n *\n * Read access to user, organization, and repositories is always included.\n */\n additionalScope?: {\n /**\n * Requests access to be able to write repository content, including\n * the ability to create things like issues and pull requests.\n */\n repoWrite?: boolean;\n };\n}\n\n/**\n * The response from a {@link ScmAuthApi.getCredentials} call.\n *\n * @public\n */\nexport interface ScmAuthTokenResponse {\n /**\n * An authorization token that can be used to authenticate requests.\n */\n token: string;\n\n /**\n * The set of HTTP headers that are needed to authenticate requests.\n */\n headers: { [name: string]: string };\n}\n\n/**\n * ScmAuthApi provides methods for authenticating towards source code management services.\n *\n * As opposed to using the GitHub, GitLab and other auth APIs\n * directly, this API allows for more generic access to SCM services.\n *\n * @public\n */\nexport interface ScmAuthApi {\n /**\n * Requests credentials for accessing an SCM resource.\n */\n getCredentials(options: ScmAuthTokenOptions): Promise<ScmAuthTokenResponse>;\n}\n\n/**\n * The ApiRef for the ScmAuthApi.\n *\n * @public\n */\nexport const scmAuthApiRef: ApiRef<ScmAuthApi> = createApiRef({\n id: 'core.scmauth',\n});\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createApiFactory,\n githubAuthApiRef,\n gitlabAuthApiRef,\n microsoftAuthApiRef,\n OAuthApi,\n} from '@backstage/core-plugin-api';\nimport {\n ScmAuthApi,\n scmAuthApiRef,\n ScmAuthTokenOptions,\n ScmAuthTokenResponse,\n} from './ScmAuthApi';\n\ntype ScopeMapping = {\n /** The base scopes used for all requests */\n default: string[];\n /** Additional scopes added if `repoWrite` is requested */\n repoWrite: string[];\n};\n\nclass ScmAuthMux implements ScmAuthApi {\n #providers: Array<ScmAuth>;\n\n constructor(providers: ScmAuth[]) {\n this.#providers = providers;\n }\n\n async getCredentials(\n options: ScmAuthTokenOptions,\n ): Promise<ScmAuthTokenResponse> {\n const url = new URL(options.url);\n const provider = this.#providers.find(p => p.isUrlSupported(url));\n if (!provider) {\n throw new Error(\n `No authentication provider available for access to '${options.url}'`,\n );\n }\n\n return provider.getCredentials(options);\n }\n}\n\n/**\n * An implementation of the ScmAuthApi that merges together OAuthApi instances\n * to form a single instance that can handles authentication for multiple providers.\n *\n * @public\n *\n * @example\n * ```\n * // Supports authentication towards both public GitHub and GHE:\n * createApiFactory({\n * api: scmAuthApiRef,\n * deps: {\n * gheAuthApi: gheAuthApiRef,\n * githubAuthApi: githubAuthApiRef,\n * },\n * factory: ({ githubAuthApi, gheAuthApi }) =>\n * ScmAuth.merge(\n * ScmAuth.forGithub(githubAuthApi),\n * ScmAuth.forGithub(gheAuthApi, {\n * host: 'ghe.example.com',\n * }),\n * )\n * })\n * ```\n */\nexport class ScmAuth implements ScmAuthApi {\n /**\n * Creates an API factory that enables auth for each of the default SCM providers.\n */\n static createDefaultApiFactory() {\n return createApiFactory({\n api: scmAuthApiRef,\n deps: {\n github: githubAuthApiRef,\n gitlab: gitlabAuthApiRef,\n azure: microsoftAuthApiRef,\n },\n factory: ({ github, gitlab, azure }) =>\n ScmAuth.merge(\n ScmAuth.forGithub(github),\n ScmAuth.forGitlab(gitlab),\n ScmAuth.forAzure(azure),\n ),\n });\n }\n\n /**\n * Creates a general purpose ScmAuth instance with a custom scope mapping.\n */\n static forAuthApi(\n authApi: OAuthApi,\n options: {\n host: string;\n scopeMapping: {\n default: string[];\n repoWrite: string[];\n };\n },\n ): ScmAuth {\n return new ScmAuth(authApi, options.host, options.scopeMapping);\n }\n\n /**\n * Creates a new ScmAuth instance that handles authentication towards GitHub.\n *\n * The host option determines which URLs that are handled by this instance and defaults to `github.com`.\n *\n * The default scopes are:\n *\n * `repo read:org read:user`\n *\n * If the additional `repoWrite` permission is requested, these scopes are added:\n *\n * `gist`\n */\n static forGithub(\n githubAuthApi: OAuthApi,\n options?: {\n host?: string;\n },\n ): ScmAuth {\n const host = options?.host ?? 'github.com';\n return new ScmAuth(githubAuthApi, host, {\n default: ['repo', 'read:org', 'read:user'],\n repoWrite: ['gist'],\n });\n }\n\n /**\n * Creates a new ScmAuth instance that handles authentication towards GitLab.\n *\n * The host option determines which URLs that are handled by this instance and defaults to `gitlab.com`.\n *\n * The default scopes are:\n *\n * `read_user read_api read_repository`\n *\n * If the additional `repoWrite` permission is requested, these scopes are added:\n *\n * `write_repository api`\n */\n static forGitlab(\n gitlabAuthApi: OAuthApi,\n options?: {\n host?: string;\n },\n ): ScmAuth {\n const host = options?.host ?? 'gitlab.com';\n return new ScmAuth(gitlabAuthApi, host, {\n default: ['read_user', 'read_api', 'read_repository'],\n repoWrite: ['write_repository', 'api'],\n });\n }\n\n /**\n * Creates a new ScmAuth instance that handles authentication towards Azure.\n *\n * The host option determines which URLs that are handled by this instance and defaults to `dev.azure.com`.\n *\n * The default scopes are:\n *\n * `vso.build vso.code vso.graph vso.project vso.profile`\n *\n * If the additional `repoWrite` permission is requested, these scopes are added:\n *\n * `vso.code_manage`\n */\n static forAzure(\n microsoftAuthApi: OAuthApi,\n options?: {\n host?: string;\n },\n ): ScmAuth {\n const host = options?.host ?? 'dev.azure.com';\n return new ScmAuth(microsoftAuthApi, host, {\n default: [\n 'vso.build',\n 'vso.code',\n 'vso.graph',\n 'vso.project',\n 'vso.profile',\n ],\n repoWrite: ['vso.code_manage'],\n });\n }\n\n /**\n * Creates a new ScmAuth instance that handles authentication towards Bitbucket.\n *\n * The host option determines which URLs that are handled by this instance and defaults to `bitbucket.org`.\n *\n * The default scopes are:\n *\n * `account team pullrequest snippet issue`\n *\n * If the additional `repoWrite` permission is requested, these scopes are added:\n *\n * `pullrequest:write snippet:write issue:write`\n */\n static forBitbucket(\n bitbucketAuthApi: OAuthApi,\n options?: {\n host?: string;\n },\n ): ScmAuth {\n const host = options?.host ?? 'bitbucket.org';\n return new ScmAuth(bitbucketAuthApi, host, {\n default: ['account', 'team', 'pullrequest', 'snippet', 'issue'],\n repoWrite: ['pullrequest:write', 'snippet:write', 'issue:write'],\n });\n }\n\n /**\n * Merges together multiple ScmAuth instances into one that\n * routes requests to the correct instance based on the URL.\n */\n static merge(...providers: ScmAuth[]): ScmAuthApi {\n return new ScmAuthMux(providers);\n }\n\n #api: OAuthApi;\n #host: string;\n #scopeMapping: ScopeMapping;\n\n private constructor(api: OAuthApi, host: string, scopeMapping: ScopeMapping) {\n this.#api = api;\n this.#host = host;\n this.#scopeMapping = scopeMapping;\n }\n\n /**\n * Checks whether the implementation is able to provide authentication for the given URL.\n */\n isUrlSupported(url: URL): boolean {\n return url.host === this.#host;\n }\n\n /**\n * Fetches credentials for the given resource.\n */\n async getCredentials(\n options: ScmAuthTokenOptions,\n ): Promise<ScmAuthTokenResponse> {\n const { url, additionalScope, ...restOptions } = options;\n\n const scopes = this.#scopeMapping.default.slice();\n if (additionalScope?.repoWrite) {\n scopes.push(...this.#scopeMapping.repoWrite);\n }\n\n const token = await this.#api.getAccessToken(scopes, restOptions);\n return {\n token,\n headers: {\n Authorization: `Bearer ${token}`,\n },\n };\n }\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Config } from '@backstage/config';\nimport {\n ScmIntegrationRegistry,\n ScmIntegrations,\n} from '@backstage/integration';\nimport { ApiRef, createApiRef } from '@backstage/core-plugin-api';\n\n/**\n * Factory class for creating {@link @backstage/integration#ScmIntegrationRegistry} instances.\n *\n * @public\n */\nexport class ScmIntegrationsApi {\n /**\n * Instantiates an {@link @backstage/integration#ScmIntegrationRegistry}.\n *\n * @param config - The root of the config hierarchy.\n */\n static fromConfig(config: Config): ScmIntegrationRegistry {\n return ScmIntegrations.fromConfig(config);\n }\n}\n\n/**\n * The API that holds all configured SCM integrations.\n *\n * @public\n */\nexport const scmIntegrationsApiRef: ApiRef<ScmIntegrationRegistry> =\n createApiRef({\n id: 'integration.scmintegrations',\n description: 'All of the registered SCM integrations of your config',\n });\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport CodeIcon from '@material-ui/icons/Code';\nimport React from 'react';\nimport { useApp } from '@backstage/core-plugin-api';\n\n/**\n * Props for {@link ScmIntegrationIcon}.\n *\n * @public\n */\nexport type ScmIntegrationIconProps = {\n /**\n * The integration type, e.g. \"github\".\n */\n type?: string;\n};\n\n/**\n * An icon that represents a certain SCM integration.\n *\n * @public\n */\nexport const ScmIntegrationIcon = (props: ScmIntegrationIconProps) => {\n const { type } = props;\n const app = useApp();\n const DefaultIcon = CodeIcon;\n const Icon = type ? app.getSystemIcon(type) ?? DefaultIcon : DefaultIcon;\n return <Icon />;\n};\n"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/integration-react",
|
|
3
3
|
"description": "Frontend package for managing integrations towards external systems",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.14",
|
|
5
5
|
"main": "dist/index.esm.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"clean": "backstage-cli clean"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@backstage/config": "^0.1.
|
|
25
|
-
"@backstage/core-components": "^0.
|
|
26
|
-
"@backstage/core-plugin-api": "^0.
|
|
27
|
-
"@backstage/integration": "^0.6.
|
|
28
|
-
"@backstage/theme": "^0.2.
|
|
24
|
+
"@backstage/config": "^0.1.11",
|
|
25
|
+
"@backstage/core-components": "^0.7.4",
|
|
26
|
+
"@backstage/core-plugin-api": "^0.2.0",
|
|
27
|
+
"@backstage/integration": "^0.6.9",
|
|
28
|
+
"@backstage/theme": "^0.2.12",
|
|
29
29
|
"@material-ui/core": "^4.12.2",
|
|
30
30
|
"@material-ui/icons": "^4.9.1",
|
|
31
31
|
"@material-ui/lab": "4.0.0-alpha.57",
|
|
@@ -34,19 +34,19 @@
|
|
|
34
34
|
"react-use": "^17.2.4"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@backstage/cli": "^0.
|
|
38
|
-
"@backstage/dev-utils": "^0.2.
|
|
39
|
-
"@backstage/test-utils": "^0.1.
|
|
37
|
+
"@backstage/cli": "^0.9.0",
|
|
38
|
+
"@backstage/dev-utils": "^0.2.13",
|
|
39
|
+
"@backstage/test-utils": "^0.1.22",
|
|
40
40
|
"@testing-library/jest-dom": "^5.10.1",
|
|
41
41
|
"@testing-library/react": "^11.2.5",
|
|
42
42
|
"@testing-library/user-event": "^13.1.8",
|
|
43
43
|
"@types/jest": "^26.0.7",
|
|
44
44
|
"@types/node": "^14.14.32",
|
|
45
45
|
"cross-fetch": "^3.0.6",
|
|
46
|
-
"msw": "^0.
|
|
46
|
+
"msw": "^0.35.0"
|
|
47
47
|
},
|
|
48
48
|
"files": [
|
|
49
49
|
"dist"
|
|
50
50
|
],
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "ddfdcd2b44dc9848cf550cea5346d5f9916a36d9"
|
|
52
52
|
}
|