Skip to content

Commit

Permalink
fix: refresh sa token (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
panuhorsmalahti authored Sep 4, 2024
1 parent 6107a76 commit c86ade2
Show file tree
Hide file tree
Showing 12 changed files with 10,148 additions and 49 deletions.
9 changes: 7 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { AgentProxy } from "./src/agent-proxy";
import { KeyPairManager } from "./src/keypair-manager";
import { version } from "./package.json";
import logger from "./src/logger";
import { serviceAccountTokenPath, ServiceAccountTokenProvider } from "./src/service-account-token";
import { existsSync } from "fs";

process.title = "bored-agent";

Expand All @@ -24,13 +26,16 @@ if (!namespace) {
process.exit(1);
}

const serviceAccountFileExists = existsSync(serviceAccountTokenPath);
const serviceAccountTokenProvider = new ServiceAccountTokenProvider(serviceAccountFileExists);

const proxy = new AgentProxy({
boredServer,
boredToken,
idpPublicKey
});
}, serviceAccountTokenProvider);

const keyPairManager = new KeyPairManager(namespace);
const keyPairManager = new KeyPairManager(namespace, serviceAccountTokenProvider);

keyPairManager.ensureKeys().then((keys) => {
proxy.init(keys);
Expand Down
Loading

0 comments on commit c86ade2

Please sign in to comment.