Skip to content

Commit 6bb6823

Browse files
authored
fix: removes rs-keyring usage and use encrypted file to store tokens (#504)
* fix: removes rs-keyring usage and use encrypted file to store tokens * fix: revert default client Id * fix: addresses review comments
1 parent 6209e7d commit 6bb6823

11 files changed

Lines changed: 166 additions & 351 deletions

e2e/setup/mock-auth-hooks.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* ESM loader hooks that replace auth.svc.ts with a mock during E2E tests.
3-
* This avoids hitting the system keyring (unavailable in CI).
3+
* This avoids writing encrypted token files during E2E tests.
44
*/
55
export async function load(url, context, nextLoad) {
66
if (url.endsWith('/service/auth.svc.ts') || url.endsWith('/service/auth.svc.js')) {

package-lock.json

Lines changed: 11 additions & 220 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
"@cyclonedx/cdxgen": "^12.1.1",
4848
"@herodevs/eol-shared": "github:herodevs/eol-shared#v0.1.18",
4949
"@inquirer/prompts": "^8.0.2",
50-
"@napi-rs/keyring": "^1.2.0",
5150
"@oclif/core": "^4.8.0",
5251
"@oclif/plugin-help": "^6.2.32",
5352
"@oclif/plugin-update": "^4.7.16",

src/service/auth-config.svc.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
const DEFAULT_REALM_URL = 'https://idp.prod.apps.herodevs.io/realms/universe/protocol/openid-connect';
22
const DEFAULT_CLIENT_ID = 'eol-ds';
3-
const DEFAULT_SERVICE_NAME = '@herodevs/cli';
4-
const DEFAULT_ACCESS_KEY = 'access-token';
5-
const DEFAULT_REFRESH_KEY = 'refresh-token';
63

74
export function getRealmUrl() {
85
return process.env.OAUTH_CONNECT_URL || DEFAULT_REALM_URL;
@@ -11,15 +8,3 @@ export function getRealmUrl() {
118
export function getClientId() {
129
return process.env.OAUTH_CLIENT_ID || DEFAULT_CLIENT_ID;
1310
}
14-
15-
export function getTokenServiceName() {
16-
return process.env.HD_AUTH_SERVICE_NAME || DEFAULT_SERVICE_NAME;
17-
}
18-
19-
export function getAccessTokenKey() {
20-
return process.env.HD_AUTH_ACCESS_KEY || DEFAULT_ACCESS_KEY;
21-
}
22-
23-
export function getRefreshTokenKey() {
24-
return process.env.HD_AUTH_REFRESH_KEY || DEFAULT_REFRESH_KEY;
25-
}

0 commit comments

Comments
 (0)