@backstage/plugin-auth-backend-module-github-provider 0.2.1-next.0 → 0.2.1
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 +18 -0
- package/config.d.ts +4 -1
- package/dist/authenticator.cjs.js +78 -0
- package/dist/authenticator.cjs.js.map +1 -0
- package/dist/index.cjs.js +8 -113
- package/dist/index.cjs.js.map +1 -1
- package/dist/module.cjs.js +33 -0
- package/dist/module.cjs.js.map +1 -0
- package/dist/resolvers.cjs.js +20 -0
- package/dist/resolvers.cjs.js.map +1 -0
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @backstage/plugin-auth-backend-module-github-provider
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 217458a: Updated configuration schema to include the new `allowedDomains` option for the `emailLocalPartMatchingUserEntityName` sign-in resolver.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/plugin-auth-node@0.5.3
|
|
10
|
+
- @backstage/backend-plugin-api@1.0.1
|
|
11
|
+
|
|
12
|
+
## 0.2.1-next.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 217458a: Updated configuration schema to include the new `allowedDomains` option for the `emailLocalPartMatchingUserEntityName` sign-in resolver.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @backstage/plugin-auth-node@0.5.3-next.1
|
|
19
|
+
- @backstage/backend-plugin-api@1.0.1-next.1
|
|
20
|
+
|
|
3
21
|
## 0.2.1-next.0
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/config.d.ts
CHANGED
|
@@ -31,7 +31,10 @@ export interface Config {
|
|
|
31
31
|
signIn?: {
|
|
32
32
|
resolvers: Array<
|
|
33
33
|
| { resolver: 'usernameMatchingUserEntityName' }
|
|
34
|
-
| {
|
|
34
|
+
| {
|
|
35
|
+
resolver: 'emailLocalPartMatchingUserEntityName';
|
|
36
|
+
allowedDomains?: string[];
|
|
37
|
+
}
|
|
35
38
|
| { resolver: 'emailMatchingUserEntityProfileEmail' }
|
|
36
39
|
>;
|
|
37
40
|
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var passportGithub2 = require('passport-github2');
|
|
4
|
+
var pluginAuthNode = require('@backstage/plugin-auth-node');
|
|
5
|
+
|
|
6
|
+
const ACCESS_TOKEN_PREFIX = "access-token.";
|
|
7
|
+
const githubAuthenticator = pluginAuthNode.createOAuthAuthenticator({
|
|
8
|
+
defaultProfileTransform: pluginAuthNode.PassportOAuthAuthenticatorHelper.defaultProfileTransform,
|
|
9
|
+
scopes: {
|
|
10
|
+
persist: true,
|
|
11
|
+
required: ["read:user"]
|
|
12
|
+
},
|
|
13
|
+
initialize({ callbackUrl, config }) {
|
|
14
|
+
const clientId = config.getString("clientId");
|
|
15
|
+
const clientSecret = config.getString("clientSecret");
|
|
16
|
+
const enterpriseInstanceUrl = config.getOptionalString("enterpriseInstanceUrl")?.replace(/\/$/, "");
|
|
17
|
+
const authorizationUrl = enterpriseInstanceUrl ? `${enterpriseInstanceUrl}/login/oauth/authorize` : void 0;
|
|
18
|
+
const tokenUrl = enterpriseInstanceUrl ? `${enterpriseInstanceUrl}/login/oauth/access_token` : void 0;
|
|
19
|
+
const userProfileUrl = enterpriseInstanceUrl ? `${enterpriseInstanceUrl}/api/v3/user` : void 0;
|
|
20
|
+
return pluginAuthNode.PassportOAuthAuthenticatorHelper.from(
|
|
21
|
+
new passportGithub2.Strategy(
|
|
22
|
+
{
|
|
23
|
+
clientID: clientId,
|
|
24
|
+
clientSecret,
|
|
25
|
+
callbackURL: callbackUrl,
|
|
26
|
+
tokenURL: tokenUrl,
|
|
27
|
+
userProfileURL: userProfileUrl,
|
|
28
|
+
authorizationURL: authorizationUrl
|
|
29
|
+
},
|
|
30
|
+
(accessToken, refreshToken, params, fullProfile, done) => {
|
|
31
|
+
done(
|
|
32
|
+
void 0,
|
|
33
|
+
{ fullProfile, params, accessToken },
|
|
34
|
+
{ refreshToken }
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
);
|
|
39
|
+
},
|
|
40
|
+
async start(input, helper) {
|
|
41
|
+
return helper.start(input, {
|
|
42
|
+
accessType: "offline",
|
|
43
|
+
prompt: "consent"
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
async authenticate(input, helper) {
|
|
47
|
+
const { fullProfile, session } = await helper.authenticate(input);
|
|
48
|
+
if (!session.refreshToken && !session.expiresInSeconds) {
|
|
49
|
+
session.refreshToken = ACCESS_TOKEN_PREFIX + session.accessToken;
|
|
50
|
+
}
|
|
51
|
+
return { fullProfile, session };
|
|
52
|
+
},
|
|
53
|
+
async refresh(input, helper) {
|
|
54
|
+
if (input.refreshToken?.startsWith(ACCESS_TOKEN_PREFIX)) {
|
|
55
|
+
const accessToken = input.refreshToken.slice(ACCESS_TOKEN_PREFIX.length);
|
|
56
|
+
const fullProfile = await helper.fetchProfile(accessToken).catch((error) => {
|
|
57
|
+
if (error.oauthError?.statusCode === 401) {
|
|
58
|
+
throw new Error("Invalid access token");
|
|
59
|
+
}
|
|
60
|
+
throw error;
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
fullProfile,
|
|
64
|
+
session: {
|
|
65
|
+
accessToken,
|
|
66
|
+
tokenType: "bearer",
|
|
67
|
+
scope: input.scope,
|
|
68
|
+
refreshToken: input.refreshToken
|
|
69
|
+
// No expiration
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return helper.refresh(input);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
exports.githubAuthenticator = githubAuthenticator;
|
|
78
|
+
//# sourceMappingURL=authenticator.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticator.cjs.js","sources":["../src/authenticator.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { Strategy as GithubStrategy } from 'passport-github2';\nimport {\n createOAuthAuthenticator,\n PassportOAuthAuthenticatorHelper,\n PassportOAuthDoneCallback,\n PassportProfile,\n} from '@backstage/plugin-auth-node';\n\nconst ACCESS_TOKEN_PREFIX = 'access-token.';\n\n/** @public */\nexport const githubAuthenticator = createOAuthAuthenticator({\n defaultProfileTransform:\n PassportOAuthAuthenticatorHelper.defaultProfileTransform,\n scopes: {\n persist: true,\n required: ['read:user'],\n },\n initialize({ callbackUrl, config }) {\n const clientId = config.getString('clientId');\n const clientSecret = config.getString('clientSecret');\n const enterpriseInstanceUrl = config\n .getOptionalString('enterpriseInstanceUrl')\n ?.replace(/\\/$/, '');\n const authorizationUrl = enterpriseInstanceUrl\n ? `${enterpriseInstanceUrl}/login/oauth/authorize`\n : undefined;\n const tokenUrl = enterpriseInstanceUrl\n ? `${enterpriseInstanceUrl}/login/oauth/access_token`\n : undefined;\n const userProfileUrl = enterpriseInstanceUrl\n ? `${enterpriseInstanceUrl}/api/v3/user`\n : undefined;\n\n return PassportOAuthAuthenticatorHelper.from(\n new GithubStrategy(\n {\n clientID: clientId,\n clientSecret: clientSecret,\n callbackURL: callbackUrl,\n tokenURL: tokenUrl,\n userProfileURL: userProfileUrl,\n authorizationURL: authorizationUrl,\n },\n (\n accessToken: string,\n refreshToken: string,\n params: any,\n fullProfile: PassportProfile,\n done: PassportOAuthDoneCallback,\n ) => {\n done(\n undefined,\n { fullProfile, params, accessToken },\n { refreshToken },\n );\n },\n ),\n );\n },\n\n async start(input, helper) {\n return helper.start(input, {\n accessType: 'offline',\n prompt: 'consent',\n });\n },\n\n async authenticate(input, helper) {\n const { fullProfile, session } = await helper.authenticate(input);\n\n // If we do not have a real refresh token and we have a non-expiring\n // access token, then we use that as our refresh token.\n if (!session.refreshToken && !session.expiresInSeconds) {\n session.refreshToken = ACCESS_TOKEN_PREFIX + session.accessToken;\n }\n return { fullProfile, session };\n },\n\n async refresh(input, helper) {\n // This is the OAuth App flow. A non-expiring access token is stored in the\n // refresh token cookie. We use that token to fetch the user profile and\n // refresh the Backstage session when needed.\n if (input.refreshToken?.startsWith(ACCESS_TOKEN_PREFIX)) {\n const accessToken = input.refreshToken.slice(ACCESS_TOKEN_PREFIX.length);\n\n const fullProfile = await helper\n .fetchProfile(accessToken)\n .catch(error => {\n if (error.oauthError?.statusCode === 401) {\n throw new Error('Invalid access token');\n }\n throw error;\n });\n\n return {\n fullProfile,\n session: {\n accessToken,\n tokenType: 'bearer',\n scope: input.scope,\n refreshToken: input.refreshToken,\n // No expiration\n },\n };\n }\n\n // This is the App flow, which is close to a standard OAuth refresh flow. It has a\n // pretty long session expiration, and it also ignores the requested scope, instead\n // just allowing access to whatever is configured as part of the app installation.\n return helper.refresh(input);\n },\n});\n"],"names":["createOAuthAuthenticator","PassportOAuthAuthenticatorHelper","GithubStrategy"],"mappings":";;;;;AAwBA,MAAM,mBAAsB,GAAA,eAAA,CAAA;AAGrB,MAAM,sBAAsBA,uCAAyB,CAAA;AAAA,EAC1D,yBACEC,+CAAiC,CAAA,uBAAA;AAAA,EACnC,MAAQ,EAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,IACT,QAAA,EAAU,CAAC,WAAW,CAAA;AAAA,GACxB;AAAA,EACA,UAAW,CAAA,EAAE,WAAa,EAAA,MAAA,EAAU,EAAA;AAClC,IAAM,MAAA,QAAA,GAAW,MAAO,CAAA,SAAA,CAAU,UA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|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var authenticator = require('./authenticator.cjs.js');
|
|
6
|
+
var module$1 = require('./module.cjs.js');
|
|
7
|
+
var resolvers = require('./resolvers.cjs.js');
|
|
8
8
|
|
|
9
|
-
const ACCESS_TOKEN_PREFIX = "access-token.";
|
|
10
|
-
const githubAuthenticator = pluginAuthNode.createOAuthAuthenticator({
|
|
11
|
-
defaultProfileTransform: pluginAuthNode.PassportOAuthAuthenticatorHelper.defaultProfileTransform,
|
|
12
|
-
scopes: {
|
|
13
|
-
persist: true,
|
|
14
|
-
required: ["read:user"]
|
|
15
|
-
},
|
|
16
|
-
initialize({ callbackUrl, config }) {
|
|
17
|
-
const clientId = config.getString("clientId");
|
|
18
|
-
const clientSecret = config.getString("clientSecret");
|
|
19
|
-
const enterpriseInstanceUrl = config.getOptionalString("enterpriseInstanceUrl")?.replace(/\/$/, "");
|
|
20
|
-
const authorizationUrl = enterpriseInstanceUrl ? `${enterpriseInstanceUrl}/login/oauth/authorize` : void 0;
|
|
21
|
-
const tokenUrl = enterpriseInstanceUrl ? `${enterpriseInstanceUrl}/login/oauth/access_token` : void 0;
|
|
22
|
-
const userProfileUrl = enterpriseInstanceUrl ? `${enterpriseInstanceUrl}/api/v3/user` : void 0;
|
|
23
|
-
return pluginAuthNode.PassportOAuthAuthenticatorHelper.from(
|
|
24
|
-
new passportGithub2.Strategy(
|
|
25
|
-
{
|
|
26
|
-
clientID: clientId,
|
|
27
|
-
clientSecret,
|
|
28
|
-
callbackURL: callbackUrl,
|
|
29
|
-
tokenURL: tokenUrl,
|
|
30
|
-
userProfileURL: userProfileUrl,
|
|
31
|
-
authorizationURL: authorizationUrl
|
|
32
|
-
},
|
|
33
|
-
(accessToken, refreshToken, params, fullProfile, done) => {
|
|
34
|
-
done(
|
|
35
|
-
void 0,
|
|
36
|
-
{ fullProfile, params, accessToken },
|
|
37
|
-
{ refreshToken }
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
);
|
|
42
|
-
},
|
|
43
|
-
async start(input, helper) {
|
|
44
|
-
return helper.start(input, {
|
|
45
|
-
accessType: "offline",
|
|
46
|
-
prompt: "consent"
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
async authenticate(input, helper) {
|
|
50
|
-
const { fullProfile, session } = await helper.authenticate(input);
|
|
51
|
-
if (!session.refreshToken && !session.expiresInSeconds) {
|
|
52
|
-
session.refreshToken = ACCESS_TOKEN_PREFIX + session.accessToken;
|
|
53
|
-
}
|
|
54
|
-
return { fullProfile, session };
|
|
55
|
-
},
|
|
56
|
-
async refresh(input, helper) {
|
|
57
|
-
if (input.refreshToken?.startsWith(ACCESS_TOKEN_PREFIX)) {
|
|
58
|
-
const accessToken = input.refreshToken.slice(ACCESS_TOKEN_PREFIX.length);
|
|
59
|
-
const fullProfile = await helper.fetchProfile(accessToken).catch((error) => {
|
|
60
|
-
if (error.oauthError?.statusCode === 401) {
|
|
61
|
-
throw new Error("Invalid access token");
|
|
62
|
-
}
|
|
63
|
-
throw error;
|
|
64
|
-
});
|
|
65
|
-
return {
|
|
66
|
-
fullProfile,
|
|
67
|
-
session: {
|
|
68
|
-
accessToken,
|
|
69
|
-
tokenType: "bearer",
|
|
70
|
-
scope: input.scope,
|
|
71
|
-
refreshToken: input.refreshToken
|
|
72
|
-
// No expiration
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
return helper.refresh(input);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
9
|
|
|
80
|
-
exports.githubSignInResolvers = void 0;
|
|
81
|
-
((githubSignInResolvers2) => {
|
|
82
|
-
githubSignInResolvers2.usernameMatchingUserEntityName = pluginAuthNode.createSignInResolverFactory({
|
|
83
|
-
create() {
|
|
84
|
-
return async (info, ctx) => {
|
|
85
|
-
const { fullProfile } = info.result;
|
|
86
|
-
const userId = fullProfile.username;
|
|
87
|
-
if (!userId) {
|
|
88
|
-
throw new Error(`GitHub user profile does not contain a username`);
|
|
89
|
-
}
|
|
90
|
-
return ctx.signInWithCatalogUser({ entityRef: { name: userId } });
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
})(exports.githubSignInResolvers || (exports.githubSignInResolvers = {}));
|
|
95
10
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
deps: {
|
|
102
|
-
providers: pluginAuthNode.authProvidersExtensionPoint
|
|
103
|
-
},
|
|
104
|
-
async init({ providers }) {
|
|
105
|
-
providers.registerProvider({
|
|
106
|
-
providerId: "github",
|
|
107
|
-
factory: pluginAuthNode.createOAuthProviderFactory({
|
|
108
|
-
authenticator: githubAuthenticator,
|
|
109
|
-
signInResolverFactories: {
|
|
110
|
-
...exports.githubSignInResolvers,
|
|
111
|
-
...pluginAuthNode.commonSignInResolvers
|
|
112
|
-
}
|
|
113
|
-
})
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
}
|
|
11
|
+
exports.githubAuthenticator = authenticator.githubAuthenticator;
|
|
12
|
+
exports.default = module$1.authModuleGithubProvider;
|
|
13
|
+
Object.defineProperty(exports, "githubSignInResolvers", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return resolvers.githubSignInResolvers; }
|
|
118
16
|
});
|
|
119
|
-
|
|
120
|
-
exports.default = authModuleGithubProvider;
|
|
121
|
-
exports.githubAuthenticator = githubAuthenticator;
|
|
122
17
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/authenticator.ts","../src/resolvers.ts","../src/module.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { Strategy as GithubStrategy } from 'passport-github2';\nimport {\n createOAuthAuthenticator,\n PassportOAuthAuthenticatorHelper,\n PassportOAuthDoneCallback,\n PassportProfile,\n} from '@backstage/plugin-auth-node';\n\nconst ACCESS_TOKEN_PREFIX = 'access-token.';\n\n/** @public */\nexport const githubAuthenticator = createOAuthAuthenticator({\n defaultProfileTransform:\n PassportOAuthAuthenticatorHelper.defaultProfileTransform,\n scopes: {\n persist: true,\n required: ['read:user'],\n },\n initialize({ callbackUrl, config }) {\n const clientId = config.getString('clientId');\n const clientSecret = config.getString('clientSecret');\n const enterpriseInstanceUrl = config\n .getOptionalString('enterpriseInstanceUrl')\n ?.replace(/\\/$/, '');\n const authorizationUrl = enterpriseInstanceUrl\n ? `${enterpriseInstanceUrl}/login/oauth/authorize`\n : undefined;\n const tokenUrl = enterpriseInstanceUrl\n ? `${enterpriseInstanceUrl}/login/oauth/access_token`\n : undefined;\n const userProfileUrl = enterpriseInstanceUrl\n ? `${enterpriseInstanceUrl}/api/v3/user`\n : undefined;\n\n return PassportOAuthAuthenticatorHelper.from(\n new GithubStrategy(\n {\n clientID: clientId,\n clientSecret: clientSecret,\n callbackURL: callbackUrl,\n tokenURL: tokenUrl,\n userProfileURL: userProfileUrl,\n authorizationURL: authorizationUrl,\n },\n (\n accessToken: string,\n refreshToken: string,\n params: any,\n fullProfile: PassportProfile,\n done: PassportOAuthDoneCallback,\n ) => {\n done(\n undefined,\n { fullProfile, params, accessToken },\n { refreshToken },\n );\n },\n ),\n );\n },\n\n async start(input, helper) {\n return helper.start(input, {\n accessType: 'offline',\n prompt: 'consent',\n });\n },\n\n async authenticate(input, helper) {\n const { fullProfile, session } = await helper.authenticate(input);\n\n // If we do not have a real refresh token and we have a non-expiring\n // access token, then we use that as our refresh token.\n if (!session.refreshToken && !session.expiresInSeconds) {\n session.refreshToken = ACCESS_TOKEN_PREFIX + session.accessToken;\n }\n return { fullProfile, session };\n },\n\n async refresh(input, helper) {\n // This is the OAuth App flow. A non-expiring access token is stored in the\n // refresh token cookie. We use that token to fetch the user profile and\n // refresh the Backstage session when needed.\n if (input.refreshToken?.startsWith(ACCESS_TOKEN_PREFIX)) {\n const accessToken = input.refreshToken.slice(ACCESS_TOKEN_PREFIX.length);\n\n const fullProfile = await helper\n .fetchProfile(accessToken)\n .catch(error => {\n if (error.oauthError?.statusCode === 401) {\n throw new Error('Invalid access token');\n }\n throw error;\n });\n\n return {\n fullProfile,\n session: {\n accessToken,\n tokenType: 'bearer',\n scope: input.scope,\n refreshToken: input.refreshToken,\n // No expiration\n },\n };\n }\n\n // This is the App flow, which is close to a standard OAuth refresh flow. It has a\n // pretty long session expiration, and it also ignores the requested scope, instead\n // just allowing access to whatever is configured as part of the app installation.\n return helper.refresh(input);\n },\n});\n","/*\n * Copyright 2023 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 createSignInResolverFactory,\n OAuthAuthenticatorResult,\n PassportProfile,\n SignInInfo,\n} from '@backstage/plugin-auth-node';\n\n/**\n * Available sign-in resolvers for the GitHub auth provider.\n *\n * @public\n */\nexport namespace githubSignInResolvers {\n /**\n * Looks up the user by matching their GitHub username to the entity name.\n */\n export const usernameMatchingUserEntityName = createSignInResolverFactory({\n create() {\n return async (\n info: SignInInfo<OAuthAuthenticatorResult<PassportProfile>>,\n ctx,\n ) => {\n const { fullProfile } = info.result;\n\n const userId = fullProfile.username;\n if (!userId) {\n throw new Error(`GitHub user profile does not contain a username`);\n }\n\n return ctx.signInWithCatalogUser({ entityRef: { name: userId } });\n };\n },\n });\n}\n","/*\n * Copyright 2023 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 { createBackendModule } from '@backstage/backend-plugin-api';\nimport {\n authProvidersExtensionPoint,\n commonSignInResolvers,\n createOAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\nimport { githubAuthenticator } from './authenticator';\nimport { githubSignInResolvers } from './resolvers';\n\n/** @public */\nexport const authModuleGithubProvider = createBackendModule({\n pluginId: 'auth',\n moduleId: 'github-provider',\n register(reg) {\n reg.registerInit({\n deps: {\n providers: authProvidersExtensionPoint,\n },\n async init({ providers }) {\n providers.registerProvider({\n providerId: 'github',\n factory: createOAuthProviderFactory({\n authenticator: githubAuthenticator,\n signInResolverFactories: {\n ...githubSignInResolvers,\n ...commonSignInResolvers,\n },\n }),\n });\n },\n });\n },\n});\n"],"names":["createOAuthAuthenticator","PassportOAuthAuthenticatorHelper","GithubStrategy","githubSignInResolvers","createSignInResolverFactory","createBackendModule","authProvidersExtensionPoint","createOAuthProviderFactory","commonSignInResolvers"],"mappings":";;;;;;;;AAwBA,MAAM,mBAAsB,GAAA,eAAA,CAAA;AAGrB,MAAM,sBAAsBA,uCAAyB,CAAA;AAAA,EAC1D,yBACEC,+CAAiC,CAAA,uBAAA;AAAA,EACnC,MAAQ,EAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,IACT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AA,CAAA;AAAA,OACH;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
4
|
+
var pluginAuthNode = require('@backstage/plugin-auth-node');
|
|
5
|
+
var authenticator = require('./authenticator.cjs.js');
|
|
6
|
+
var resolvers = require('./resolvers.cjs.js');
|
|
7
|
+
|
|
8
|
+
const authModuleGithubProvider = backendPluginApi.createBackendModule({
|
|
9
|
+
pluginId: "auth",
|
|
10
|
+
moduleId: "github-provider",
|
|
11
|
+
register(reg) {
|
|
12
|
+
reg.registerInit({
|
|
13
|
+
deps: {
|
|
14
|
+
providers: pluginAuthNode.authProvidersExtensionPoint
|
|
15
|
+
},
|
|
16
|
+
async init({ providers }) {
|
|
17
|
+
providers.registerProvider({
|
|
18
|
+
providerId: "github",
|
|
19
|
+
factory: pluginAuthNode.createOAuthProviderFactory({
|
|
20
|
+
authenticator: authenticator.githubAuthenticator,
|
|
21
|
+
signInResolverFactories: {
|
|
22
|
+
...resolvers.githubSignInResolvers,
|
|
23
|
+
...pluginAuthNode.commonSignInResolvers
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
exports.authModuleGithubProvider = authModuleGithubProvider;
|
|
33
|
+
//# sourceMappingURL=module.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { createBackendModule } from '@backstage/backend-plugin-api';\nimport {\n authProvidersExtensionPoint,\n commonSignInResolvers,\n createOAuthProviderFactory,\n} from '@backstage/plugin-auth-node';\nimport { githubAuthenticator } from './authenticator';\nimport { githubSignInResolvers } from './resolvers';\n\n/** @public */\nexport const authModuleGithubProvider = createBackendModule({\n pluginId: 'auth',\n moduleId: 'github-provider',\n register(reg) {\n reg.registerInit({\n deps: {\n providers: authProvidersExtensionPoint,\n },\n async init({ providers }) {\n providers.registerProvider({\n providerId: 'github',\n factory: createOAuthProviderFactory({\n authenticator: githubAuthenticator,\n signInResolverFactories: {\n ...githubSignInResolvers,\n ...commonSignInResolvers,\n },\n }),\n });\n },\n });\n },\n});\n"],"names":["createBackendModule","authProvidersExtensionPoint","createOAuthProviderFactory","githubAuthenticator","githubSignInResolvers","commonSignInResolvers"],"mappings":";;;;;;;AAyBO,MAAM,2BAA2BA,oCAAoB,CAAA;AAAA,EAC1D,QAAU,EAAA,MAAA;AAAA,EACV,QAAU,EAAA,iBAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,SAAW,EAAAC,0CAAA;AAAA,OACb;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,SAAA,EAAa,EAAA;AACxB,QAAA,SAAA,CAAU,gBAAiB,CAAA;AAAA,UACzB,UAAY,EAAA,QAAA;AAAA,UACZ,SAASC,yCAA2B,CAAA;AAAA,YAClC,aAAe,EAAAC,iCAAA;AAAA,YACf,uBAAyB,EAAA;AAAA,cACvB,GAAGC,+BAAA;AAAA,cACH,GAAGC,oCAAA;AAAA,aACL;AAAA,WACD,CAAA;AAAA,SACF,CAAA,CAAA;AAAA,OACH;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var pluginAuthNode = require('@backstage/plugin-auth-node');
|
|
4
|
+
|
|
5
|
+
exports.githubSignInResolvers = void 0;
|
|
6
|
+
((githubSignInResolvers2) => {
|
|
7
|
+
githubSignInResolvers2.usernameMatchingUserEntityName = pluginAuthNode.createSignInResolverFactory({
|
|
8
|
+
create() {
|
|
9
|
+
return async (info, ctx) => {
|
|
10
|
+
const { fullProfile } = info.result;
|
|
11
|
+
const userId = fullProfile.username;
|
|
12
|
+
if (!userId) {
|
|
13
|
+
throw new Error(`GitHub user profile does not contain a username`);
|
|
14
|
+
}
|
|
15
|
+
return ctx.signInWithCatalogUser({ entityRef: { name: userId } });
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
})(exports.githubSignInResolvers || (exports.githubSignInResolvers = {}));
|
|
20
|
+
//# sourceMappingURL=resolvers.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolvers.cjs.js","sources":["../src/resolvers.ts"],"sourcesContent":["/*\n * Copyright 2023 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 createSignInResolverFactory,\n OAuthAuthenticatorResult,\n PassportProfile,\n SignInInfo,\n} from '@backstage/plugin-auth-node';\n\n/**\n * Available sign-in resolvers for the GitHub auth provider.\n *\n * @public\n */\nexport namespace githubSignInResolvers {\n /**\n * Looks up the user by matching their GitHub username to the entity name.\n */\n export const usernameMatchingUserEntityName = createSignInResolverFactory({\n create() {\n return async (\n info: SignInInfo<OAuthAuthenticatorResult<PassportProfile>>,\n ctx,\n ) => {\n const { fullProfile } = info.result;\n\n const userId = fullProfile.username;\n if (!userId) {\n throw new Error(`GitHub user profile does not contain a username`);\n }\n\n return ctx.signInWithCatalogUser({ entityRef: { name: userId } });\n };\n },\n });\n}\n"],"names":["githubSignInResolvers","createSignInResolverFactory"],"mappings":";;;;AA4BiBA,uCAAA;AAAA,CAAV,CAAUA,sBAAV,KAAA;AAIE,EAAMA,sBAAAA,CAAA,iCAAiCC,0CAA4B,CAAA;AAAA,IACxE,MAAS,GAAA;AACP,MAAO,OAAA,OACL,MACA,GACG,KAAA;AACH,QAAM,MAAA,EAAE,WAAY,EAAA,GAAI,IAAK,CAAA,MAAA,CAAA;AAE7B,QAAA,MAAM,SAAS,WAAY,CAAA,QAAA,CAAA;AAC3B,QAAA,IAAI,CAAC,MAAQ,EAAA;AACX,UAAM,MAAA,IAAI,MAAM,CAAiD,+CAAA,CAAA,CAAA,CAAA;AAAA,SACnE;AAEA,QAAO,OAAA,GAAA,CAAI,sBAAsB,EAAE,SAAA,EAAW,EAAE,IAAM,EAAA,MAAA,IAAU,CAAA,CAAA;AAAA,OAClE,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AAAA,CApBc,EAAAD,6BAAA,KAAAA,6BAAA,GAAA,EAAA,CAAA,CAAA;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-auth-backend-module-github-provider",
|
|
3
|
-
"version": "0.2.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "The github-provider backend module for the auth plugin.",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "backend-plugin-module",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"test": "backstage-cli package test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@backstage/backend-plugin-api": "^1.0.1
|
|
38
|
-
"@backstage/plugin-auth-node": "^0.5.3
|
|
37
|
+
"@backstage/backend-plugin-api": "^1.0.1",
|
|
38
|
+
"@backstage/plugin-auth-node": "^0.5.3",
|
|
39
39
|
"passport-github2": "^0.1.12"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@backstage/backend-defaults": "^0.5.1
|
|
43
|
-
"@backstage/backend-test-utils": "^1.0.1
|
|
44
|
-
"@backstage/cli": "^0.28.0
|
|
45
|
-
"@backstage/plugin-auth-backend": "^0.23.1
|
|
42
|
+
"@backstage/backend-defaults": "^0.5.1",
|
|
43
|
+
"@backstage/backend-test-utils": "^1.0.1",
|
|
44
|
+
"@backstage/cli": "^0.28.0",
|
|
45
|
+
"@backstage/plugin-auth-backend": "^0.23.1",
|
|
46
46
|
"supertest": "^7.0.0"
|
|
47
47
|
},
|
|
48
48
|
"configSchema": "config.d.ts"
|