5
0
Fork 0
mirror of https://github.com/hashicorp/vault-action.git synced 2025-11-07 15:16:56 +00:00

Corrected IAT and added explicit value for the mock test

This commit is contained in:
Keith Murry 2024-02-19 14:32:49 -06:00
parent 2c6158aeef
commit da8ea015b7
2 changed files with 3 additions and 3 deletions

View file

@ -44,7 +44,7 @@ function mockGithubOIDCResponse(aud= "https://github.com/hashicorp/vault-action"
ref_type: "branch", ref_type: "branch",
job_workflow_ref: "hashicorp/vault-action/.github/workflows/workflow.yml@refs/heads/main", job_workflow_ref: "hashicorp/vault-action/.github/workflows/workflow.yml@refs/heads/main",
iss: 'vault-action', iss: 'vault-action',
iat: now, iat: now - 60,
nbf: now, nbf: now,
exp: now + 3600, exp: now + 3600,
}; };

View file

@ -88,8 +88,8 @@ function generateJwt(privateKey, keyPassword, ttl, iat) {
const now = rsasign.KJUR.jws.IntDate.getNow(); const now = rsasign.KJUR.jws.IntDate.getNow();
const payload = { const payload = {
iss: 'vault-action', iss: 'vault-action',
iat: now, iat: now - iat,
nbf: now - iat, nbf: now,
exp: now + ttl, exp: now + ttl,
event: process.env.GITHUB_EVENT_NAME, event: process.env.GITHUB_EVENT_NAME,
workflow: process.env.GITHUB_WORKFLOW, workflow: process.env.GITHUB_WORKFLOW,