@faable/faable 1.5.17-next.23 → 1.5.17-next.25
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.
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import axios from 'axios';
|
|
2
2
|
|
|
3
|
+
const auth = axios.create({
|
|
4
|
+
baseURL: "https://faable.auth.staging.faable.link",
|
|
5
|
+
});
|
|
3
6
|
const exchangeGithubOidcToken = async (gh_token) => {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
token:
|
|
7
|
+
const res = await auth.post("/oauth/token", {
|
|
8
|
+
grant_type: "urn:ietf:params:oauth:grant-type:token-exchange",
|
|
9
|
+
subject_token_type: "urn:ietf:params:oauth:token-type:jwt",
|
|
10
|
+
subject_token: gh_token,
|
|
11
|
+
resource: "https://faable.com",
|
|
12
|
+
audience: "https://faable.com",
|
|
13
|
+
scope: "openid email profile",
|
|
14
|
+
client_id: "a6f1381a-2591-4f18-aaa4-b8922ac91fce"
|
|
7
15
|
});
|
|
8
|
-
|
|
9
|
-
return { token, app_id };
|
|
16
|
+
return res.data;
|
|
10
17
|
};
|
|
11
18
|
const oidc_strategy = (config) => {
|
|
12
19
|
const { idToken } = config;
|
|
@@ -21,7 +28,7 @@ const oidc_strategy = (config) => {
|
|
|
21
28
|
token_ex = ex;
|
|
22
29
|
}
|
|
23
30
|
return {
|
|
24
|
-
Authorization: `Bearer ${token_ex.
|
|
31
|
+
Authorization: `Bearer ${token_ex.access_token}`,
|
|
25
32
|
};
|
|
26
33
|
},
|
|
27
34
|
app_id: async () => {
|
|
@@ -29,7 +36,7 @@ const oidc_strategy = (config) => {
|
|
|
29
36
|
const ex = await exchangeGithubOidcToken(idToken);
|
|
30
37
|
token_ex = ex;
|
|
31
38
|
}
|
|
32
|
-
return token_ex.
|
|
39
|
+
return token_ex.access_token;
|
|
33
40
|
}
|
|
34
41
|
};
|
|
35
42
|
};
|
|
@@ -56,7 +56,7 @@ const link = {
|
|
|
56
56
|
const gitUrl = await getGitRemoteUrl(workdir);
|
|
57
57
|
const apps = await api.list();
|
|
58
58
|
if (apps.length === 0) {
|
|
59
|
-
log.error("No apps found in your account. Create one first at https://faable.
|
|
59
|
+
log.error("No apps found in your account. Create one first at https://faable.com");
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
const { selectedApp } = await prompts({
|