Review fixes

This commit is contained in:
x032205
2025-06-19 15:12:41 -04:00
parent 7a13c27055
commit 9ac4453523
3 changed files with 23 additions and 28 deletions
@@ -33,8 +33,8 @@ export const GithubProvider = (): TDynamicProviderFns => {
const nowInSeconds = Math.floor(Date.now() / 1000); const nowInSeconds = Math.floor(Date.now() / 1000);
const jwtPayload = { const jwtPayload = {
iat: nowInSeconds - 60, iat: nowInSeconds - 5,
exp: nowInSeconds + 10 * 60 - 60, exp: nowInSeconds + 60,
iss: String(appId) iss: String(appId)
}; };
@@ -110,9 +110,12 @@ export const GithubProvider = (): TDynamicProviderFns => {
}; };
}; };
const revoke = async (_inputs: unknown, entityId: string) => { const revoke = async () => {
// GitHub installation access tokens cannot be revoked. // GitHub installation tokens cannot be revoked.
return { entityId }; throw new BadRequestError({
message:
"Github dynamic secret does not support revocation because GitHub itself cannot revoke installation tokens"
});
}; };
const renew = async () => { const renew = async () => {
@@ -1,23 +1,15 @@
--- ---
title: "Github" title: "GitHub"
description: "Learn how to dynamically generate Github app tokens." description: "Learn how to dynamically generate GitHub App tokens."
--- ---
The Infisical Github dynamic secret allows you to generate short-lived tokens for a Github app on demand based on service account permissions. The Infisical GitHub dynamic secret allows you to generate short-lived tokens for a GitHub App on demand based on service account permissions.
<Warning> ## Setup GitHub App
Github app tokens cannot be revoked. As such, revoking a token on Infisical does not invalidate the Github token; it remains active until it expires.
</Warning>
<Warning>
Github app tokens are fixed to a TTL of 1 hour.
</Warning>
## Setup Github App
<Steps> <Steps>
<Step title="Create an application on GitHub"> <Step title="Create an application on GitHub">
Navigate to [GitHub app settings](https://github.com/settings/apps) and click **New GitHub App**. Navigate to [GitHub App settings](https://github.com/settings/apps) and click **New GitHub App**.
![integrations github app create](/images/integrations/github/app/self-hosted-github-app-create.png) ![integrations github app create](/images/integrations/github/app/self-hosted-github-app-create.png)
@@ -26,9 +18,9 @@ The Infisical Github dynamic secret allows you to generate short-lived tokens fo
Disable webhook by unchecking the Active checkbox. Disable webhook by unchecking the Active checkbox.
![integrations github app webhook](/images/integrations/github/app/self-hosted-github-app-webhook.png) ![integrations github app webhook](/images/integrations/github/app/self-hosted-github-app-webhook.png)
Configure the app's permissions to grant the necessary access for the dynamic secret's short-lived tokens. Configure the app's permissions to grant the necessary access for the dynamic secret's short-lived tokens based on your use case.
Create the Github application. Create the GitHub Application.
![integrations github app create confirm](/images/integrations/github/app/self-hosted-github-app-create-confirm.png) ![integrations github app create confirm](/images/integrations/github/app/self-hosted-github-app-create-confirm.png)
<Note> <Note>
@@ -37,7 +29,7 @@ The Infisical Github dynamic secret allows you to generate short-lived tokens fo
</Note> </Note>
</Step> </Step>
<Step title="Save app credentials"> <Step title="Save app credentials">
Copy the **App ID** and generate a new **Private Key** for your Github application. Copy the **App ID** and generate a new **Private Key** for your GitHub Application.
![integrations github app create private key](/images/integrations/github/app/self-hosted-github-app-private-key.png) ![integrations github app create private key](/images/integrations/github/app/self-hosted-github-app-private-key.png)
Save these for later steps. Save these for later steps.
@@ -53,7 +45,7 @@ The Infisical Github dynamic secret allows you to generate short-lived tokens fo
</Step> </Step>
</Steps> </Steps>
## Set up Dynamic Secrets with Github ## Set up Dynamic Secrets with GitHub
<Steps> <Steps>
<Step title="Open Secret Overview Dashboard"> <Step title="Open Secret Overview Dashboard">
@@ -62,7 +54,7 @@ The Infisical Github dynamic secret allows you to generate short-lived tokens fo
<Step title="Click on the 'Add Dynamic Secret' button"> <Step title="Click on the 'Add Dynamic Secret' button">
![Add Dynamic Secret Button](../../../images/platform/dynamic-secrets/add-dynamic-secret-button.png) ![Add Dynamic Secret Button](../../../images/platform/dynamic-secrets/add-dynamic-secret-button.png)
</Step> </Step>
<Step title="Select 'Github'"> <Step title="Select 'GitHub'">
![Dynamic Secret Modal](../../../images/platform/dynamic-secrets/github/modal.png) ![Dynamic Secret Modal](../../../images/platform/dynamic-secrets/github/modal.png)
</Step> </Step>
<Step title="Provide the inputs for dynamic secret parameters"> <Step title="Provide the inputs for dynamic secret parameters">
@@ -110,11 +102,11 @@ This will allow you to see the expiration time of the lease or delete a lease be
![Lease Data](/images/platform/dynamic-secrets/lease-data.png) ![Lease Data](/images/platform/dynamic-secrets/lease-data.png)
<Warning> <Warning>
Github app tokens cannot be revoked. As such, revoking a token on Infisical does not invalidate the Github token; it remains active until it expires. GitHub App tokens cannot be revoked. As such, revoking a token on Infisical does not invalidate the GitHub token; it remains active until it expires.
</Warning> </Warning>
## Renew Leases ## Renew Leases
<Warning> <Note>
Github app tokens cannot be renewed because they are fixed to a lifetime of 1 hour. GitHub App tokens cannot be renewed because they are fixed to a lifetime of 1 hour.
</Warning> </Note>
@@ -148,7 +148,7 @@ const DYNAMIC_SECRET_LIST = [
{ {
icon: <FontAwesomeIcon icon={faGithub} size="lg" />, icon: <FontAwesomeIcon icon={faGithub} size="lg" />,
provider: DynamicSecretProviders.Github, provider: DynamicSecretProviders.Github,
title: "Github" title: "GitHub"
} }
]; ];