add jwtGiteaOIDC input
This commit is contained in:
@@ -82,6 +82,9 @@ inputs:
|
|||||||
jwtGithubAudience:
|
jwtGithubAudience:
|
||||||
description: 'Identifies the recipient ("aud" claim) that the JWT is intended for'
|
description: 'Identifies the recipient ("aud" claim) that the JWT is intended for'
|
||||||
required: false
|
required: false
|
||||||
|
jwtGiteaOIDC:
|
||||||
|
description: 'JWT obtained from a Gitea OIDC App'
|
||||||
|
required: false
|
||||||
jwtTtl:
|
jwtTtl:
|
||||||
description: 'Time in seconds, after which token expires'
|
description: 'Time in seconds, after which token expires'
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
Vendored
+5
-1
@@ -18798,8 +18798,12 @@ async function retrieveToken(method, client) {
|
|||||||
const keyPassword = core.getInput('jwtKeyPassword', { required: false });
|
const keyPassword = core.getInput('jwtKeyPassword', { required: false });
|
||||||
const tokenTtl = core.getInput('jwtTtl', { required: false }) || '3600'; // 1 hour
|
const tokenTtl = core.getInput('jwtTtl', { required: false }) || '3600'; // 1 hour
|
||||||
const githubAudience = core.getInput('jwtGithubAudience', { required: false });
|
const githubAudience = core.getInput('jwtGithubAudience', { required: false });
|
||||||
|
const jwtGiteaOIDC = core.getInput('jwtGiteaOIDC', { required: false });
|
||||||
|
|
||||||
if (!privateKey) {
|
if (jwtGiteaOIDC) {
|
||||||
|
jwt = jwtGiteaOIDC
|
||||||
|
}
|
||||||
|
else if (!privateKey) {
|
||||||
jwt = await core.getIDToken(githubAudience)
|
jwt = await core.getIDToken(githubAudience)
|
||||||
} else {
|
} else {
|
||||||
jwt = generateJwt(privateKey, keyPassword, Number(tokenTtl));
|
jwt = generateJwt(privateKey, keyPassword, Number(tokenTtl));
|
||||||
|
|||||||
+22
-22
@@ -8,26 +8,26 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 8200:8200
|
- 8200:8200
|
||||||
privileged: true
|
privileged: true
|
||||||
vault-enterprise:
|
# vault-enterprise:
|
||||||
image: hashicorp/vault-enterprise:latest
|
# image: hashicorp/vault-enterprise:latest
|
||||||
environment:
|
# environment:
|
||||||
VAULT_DEV_ROOT_TOKEN_ID: testtoken
|
# VAULT_DEV_ROOT_TOKEN_ID: testtoken
|
||||||
VAULT_LICENSE: ${VAULT_LICENSE_CI}
|
# VAULT_LICENSE: ${VAULT_LICENSE_CI}
|
||||||
ports:
|
# ports:
|
||||||
- 8200:8200
|
# - 8200:8200
|
||||||
privileged: true
|
# privileged: true
|
||||||
vault-tls:
|
# vault-tls:
|
||||||
image: hashicorp/vault:latest
|
# image: hashicorp/vault:latest
|
||||||
hostname: vault-tls
|
# hostname: vault-tls
|
||||||
environment:
|
# environment:
|
||||||
VAULT_CAPATH: /etc/vault/ca.crt
|
# VAULT_CAPATH: /etc/vault/ca.crt
|
||||||
ports:
|
# ports:
|
||||||
- 8200:8200
|
# - 8200:8200
|
||||||
privileged: true
|
# privileged: true
|
||||||
volumes:
|
# volumes:
|
||||||
- ${PWD}/integrationTests/e2e-tls/configs:/etc/vault
|
# - ${PWD}/integrationTests/e2e-tls/configs:/etc/vault
|
||||||
- vault-data:/var/lib/vault:rw
|
# - vault-data:/var/lib/vault:rw
|
||||||
entrypoint: vault server -config=/etc/vault/config.hcl
|
# entrypoint: vault server -config=/etc/vault/config.hcl
|
||||||
|
|
||||||
volumes:
|
# volumes:
|
||||||
vault-data:
|
# vault-data:
|
||||||
|
|||||||
+5
-1
@@ -33,8 +33,12 @@ async function retrieveToken(method, client) {
|
|||||||
const keyPassword = core.getInput('jwtKeyPassword', { required: false });
|
const keyPassword = core.getInput('jwtKeyPassword', { required: false });
|
||||||
const tokenTtl = core.getInput('jwtTtl', { required: false }) || '3600'; // 1 hour
|
const tokenTtl = core.getInput('jwtTtl', { required: false }) || '3600'; // 1 hour
|
||||||
const githubAudience = core.getInput('jwtGithubAudience', { required: false });
|
const githubAudience = core.getInput('jwtGithubAudience', { required: false });
|
||||||
|
const jwtGiteaOIDC = core.getInput('jwtGiteaOIDC', { required: false });
|
||||||
|
|
||||||
if (!privateKey) {
|
if (jwtGiteaOIDC) {
|
||||||
|
jwt = jwtGiteaOIDC
|
||||||
|
}
|
||||||
|
else if (!privateKey) {
|
||||||
jwt = await core.getIDToken(githubAudience)
|
jwt = await core.getIDToken(githubAudience)
|
||||||
} else {
|
} else {
|
||||||
jwt = generateJwt(privateKey, keyPassword, Number(tokenTtl));
|
jwt = generateJwt(privateKey, keyPassword, Number(tokenTtl));
|
||||||
|
|||||||
Reference in New Issue
Block a user