From f37fa2bbf5aa9385215a6fb1da15798fc413cf65 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard <62331820+DanielHougaard@users.noreply.github.com> Date: Sun, 24 Dec 2023 17:10:54 +0400 Subject: [PATCH 1/8] Updated Java docs --- docs/sdks/languages/java.mdx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/sdks/languages/java.mdx b/docs/sdks/languages/java.mdx index a73d1bd09..5f4c7d557 100644 --- a/docs/sdks/languages/java.mdx +++ b/docs/sdks/languages/java.mdx @@ -19,6 +19,7 @@ public class Example { ClientSettings settings = new ClientSettings(); settings.setClientID("MACHINE_IDENTITY_CLIENT_ID"); settings.setClientSecret("MACHINE_IDENTITY_CLIENT_SECRET"); + settings.setCacheTTL(Long.valueOf(300)); // 300 seconds, 5 minutes InfisicalClient client = new InfisicalClient(settings); @@ -88,6 +89,11 @@ public class App { An access token obtained from the machine identity login endpoint. + + Time-to-live (in seconds) for refreshing cached secrets. + If manually set to 0, caching will be disabled, this is not recommended. + + Your self-hosted absolute site URL including the protocol (e.g. `https://app.infisical.com`) @@ -95,6 +101,10 @@ public class App { +### Caching + +The SDK caches every secret and updates it periodically based on the provided cacheTTL. For example, if cacheTTL of 300 is provided, then a secret will be refetched every 5 minutes. The SDK first attempts to return the cached secret, but if no secret is found it'll make a request to get the fresh secret. Every time the secret is fetched from the cache, the cached secret expiry is reset. + ## Working with Secrets ### client.listSecrets(options) @@ -127,7 +137,11 @@ Retrieve all secrets within the Infisical project and environment that client is The path from where secrets should be fetched from. - + + Whether or not to set the fetched secrets to the process environment. If true, you can access the secrets like so `System.getenv("SECRET_NAME")`. + + + Whether or not to include imported secrets from the current path. Read about [secret import](/documentation/platform/secret-reference) From 8df22302fd6df3ce169b3fca3f31b1ababd18989 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard <62331820+DanielHougaard@users.noreply.github.com> Date: Sun, 24 Dec 2023 17:11:03 +0400 Subject: [PATCH 2/8] Updated Node docs --- docs/sdks/languages/node.mdx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/sdks/languages/node.mdx b/docs/sdks/languages/node.mdx index 34cce93ab..d6dfc7564 100644 --- a/docs/sdks/languages/node.mdx +++ b/docs/sdks/languages/node.mdx @@ -104,6 +104,11 @@ Import the SDK and create a client instance with your [Machine Identity](/docume An access token obtained from the machine identity login endpoint. + + Time-to-live (in seconds) for refreshing cached secrets. + If manually set to 0, caching will be disabled, this is not recommended. + + Your self-hosted absolute site URL including the protocol (e.g. `https://app.infisical.com`) @@ -113,6 +118,11 @@ Import the SDK and create a client instance with your [Machine Identity](/docume + +### Caching + +The SDK caches every secret and updates it periodically based on the provided cacheTTL. For example, if cacheTTL of 300 is provided, then a secret will be refetched every 5 minutes. The SDK first attempts to return the cached secret, but if no secret is found it'll make a request to get the fresh secret. Every time the secret is fetched from the cache, the cached secret expiry is reset. + ## Working with Secrets ### client.listSecrets(options) @@ -143,7 +153,11 @@ Retrieve all secrets within the Infisical project and environment that client is The path from where secrets should be fetched from. - + + Whether or not to set the fetched secrets to the process environment. If true, you can access the secrets like so `process.env["SECRET_NAME"]`. + + + Whether or not to include imported secrets from the current path. Read about [secret import](/documentation/platform/secret-reference) From c46325605897effba87dafce888ebda8c8b200fa Mon Sep 17 00:00:00 2001 From: Daniel Hougaard <62331820+DanielHougaard@users.noreply.github.com> Date: Sun, 24 Dec 2023 17:11:08 +0400 Subject: [PATCH 3/8] Updated Python docs --- docs/sdks/languages/python.mdx | 60 ++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 20 deletions(-) diff --git a/docs/sdks/languages/python.mdx b/docs/sdks/languages/python.mdx index e8c4a90c6..0a7ad3ef6 100644 --- a/docs/sdks/languages/python.mdx +++ b/docs/sdks/languages/python.mdx @@ -62,24 +62,40 @@ client = InfisicalClient(ClientSettings( ### Parameters - - Your Infisical Client ID. - - - Your Infisical Client Secret. - - - If you want to directly pass an access token obtained from the authentication endpoints, you can do so. - - - Your self-hosted absolute site URL including the protocol (e.g. - `https://app.infisical.com`) - + + + + Your Infisical Client ID. + + + Your Infisical Client Secret. + + + If you want to directly pass an access token obtained from the authentication endpoints, you can do so. + + + + Time-to-live (in seconds) for refreshing cached secrets. + If manually set to 0, caching will be disabled, this is not recommended. + + + + + Your self-hosted absolute site URL including the protocol (e.g. + `https://app.infisical.com`) + + + + + +### Caching + +The SDK caches every secret and updates it periodically based on the provided cacheTTL. For example, if cacheTTL of 300 is provided, then a secret will be refetched every 5 minutes. The SDK first attempts to return the cached secret, but if no secret is found it'll make a request to get the fresh secret. Every time the secret is fetched from the cache, the cached secret expiry is reset. ## Working with Secrets @@ -109,7 +125,11 @@ Retrieve all secrets within the Infisical project and environment that client is The path from where secrets should be fetched from. - + + Whether or not to set the fetched secrets to the process environment. If true, you can access the secrets like so `process.env["SECRET_NAME"]`. + + + Whether or not to include imported secrets from the current path. Read about [secret import](/documentation/platform/secret-reference) @@ -148,7 +168,7 @@ By default, `getSecret()` fetches and returns a shared secret. If not found, it The type of the secret. Valid options are "shared" or "personal". If not specified, the default value is "personal". - + Whether or not to include imported secrets from the current path. Read about [secret import](/documentation/platform/secret-reference) From dc3f85e92e5e9da81a9ae436f2ead7588edcd87f Mon Sep 17 00:00:00 2001 From: Daniel Hougaard <62331820+DanielHougaard@users.noreply.github.com> Date: Sun, 24 Dec 2023 17:11:20 +0400 Subject: [PATCH 4/8] Re-added an updated FAQ --- docs/sdks/overview.mdx | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/docs/sdks/overview.mdx b/docs/sdks/overview.mdx index b26330f18..b05f0b395 100644 --- a/docs/sdks/overview.mdx +++ b/docs/sdks/overview.mdx @@ -31,3 +31,36 @@ From local development to production, Infisical SDKs provide the easiest way for Manage secrets for your PHP application on demand + +## FAQ + + + + The client SDK caches every secret and implements a 5-minute waiting period before + re-requesting it. The waiting period can be controlled by setting the `cacheTTL` parameter at + the time of initializing the client. + + Note: The exact parameter name may differ depending on the language. + + + Yes you can! The client SDK provides a method to attach the secrets to your process environment. + When using the `listSecrets()` method, you can pass a `attachToProcessEnv` parameter, which tells the SDK to attach all the found secrets to your process environment. + + Note: The exact parameter name may differ depending on the language. + + + The SDK caches every secret and falls back to the cached value if a request fails. If no cached value is found, and the request fails, then the SDK throws an error. + + + The token enables the SDK to authenticate with Infisical to fetch back your secrets. + Although the SDK requires you to pass in a token, it enables greater efficiency and security + than if you managed dozens of secrets yourself without it. Here're some benefits: + + - You always pull in the right secrets because they're fetched on demand from a centralize source that is Infisical. + - You can use the Infisical which comes with tons of benefits like secret versioning, access controls, audit logs, etc. + - You now risk leaking one token that can be revoked instead of dozens of raw secrets. + + And much more. + + + From 094fe739176d735eaf279f5ed01d3e1360f942b3 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard <62331820+DanielHougaard@users.noreply.github.com> Date: Sun, 24 Dec 2023 21:36:31 +0400 Subject: [PATCH 5/8] Updated Java caching docs --- docs/sdks/languages/java.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sdks/languages/java.mdx b/docs/sdks/languages/java.mdx index 5f4c7d557..7c3ec5599 100644 --- a/docs/sdks/languages/java.mdx +++ b/docs/sdks/languages/java.mdx @@ -103,7 +103,7 @@ public class App { ### Caching -The SDK caches every secret and updates it periodically based on the provided cacheTTL. For example, if cacheTTL of 300 is provided, then a secret will be refetched every 5 minutes. The SDK first attempts to return the cached secret, but if no secret is found it'll make a request to get the fresh secret. Every time the secret is fetched from the cache, the cached secret expiry is reset. +To reduce the number of API requests, the SDK temporarily stores secrets it retrieves. By default, a secret remains cached for 5 minutes after it's first fetched. Each time it's fetched again, this 5-minute timer resets. You can adjust this caching duration by setting the "cacheTTL" option when creating the client. ## Working with Secrets From e9b599656717171de4ab2d130d5c5ef99bb628f0 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard <62331820+DanielHougaard@users.noreply.github.com> Date: Sun, 24 Dec 2023 21:36:40 +0400 Subject: [PATCH 6/8] Updated node caching docs --- docs/sdks/languages/node.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sdks/languages/node.mdx b/docs/sdks/languages/node.mdx index d6dfc7564..9179e2f9d 100644 --- a/docs/sdks/languages/node.mdx +++ b/docs/sdks/languages/node.mdx @@ -121,7 +121,7 @@ Import the SDK and create a client instance with your [Machine Identity](/docume ### Caching -The SDK caches every secret and updates it periodically based on the provided cacheTTL. For example, if cacheTTL of 300 is provided, then a secret will be refetched every 5 minutes. The SDK first attempts to return the cached secret, but if no secret is found it'll make a request to get the fresh secret. Every time the secret is fetched from the cache, the cached secret expiry is reset. +To reduce the number of API requests, the SDK temporarily stores secrets it retrieves. By default, a secret remains cached for 5 minutes after it's first fetched. Each time it's fetched again, this 5-minute timer resets. You can adjust this caching duration by setting the "cacheTtl" option when creating the client. ## Working with Secrets From d6e55f51f2b086313b9105143d784b348f448507 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard <62331820+DanielHougaard@users.noreply.github.com> Date: Sun, 24 Dec 2023 21:36:47 +0400 Subject: [PATCH 7/8] Updated Python docs --- docs/sdks/languages/python.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sdks/languages/python.mdx b/docs/sdks/languages/python.mdx index 0a7ad3ef6..8420e6e77 100644 --- a/docs/sdks/languages/python.mdx +++ b/docs/sdks/languages/python.mdx @@ -95,7 +95,7 @@ client = InfisicalClient(ClientSettings( ### Caching -The SDK caches every secret and updates it periodically based on the provided cacheTTL. For example, if cacheTTL of 300 is provided, then a secret will be refetched every 5 minutes. The SDK first attempts to return the cached secret, but if no secret is found it'll make a request to get the fresh secret. Every time the secret is fetched from the cache, the cached secret expiry is reset. +To reduce the number of API requests, the SDK temporarily stores secrets it retrieves. By default, a secret remains cached for 5 minutes after it's first fetched. Each time it's fetched again, this 5-minute timer resets. You can adjust this caching duration by setting the "cache_ttl" option when creating the client. ## Working with Secrets From db27beaf0b2726d1825098536174c25618bc1596 Mon Sep 17 00:00:00 2001 From: Daniel Hougaard <62331820+DanielHougaard@users.noreply.github.com> Date: Sun, 24 Dec 2023 21:54:57 +0400 Subject: [PATCH 8/8] Update overview.mdx --- docs/sdks/overview.mdx | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/docs/sdks/overview.mdx b/docs/sdks/overview.mdx index b05f0b395..aca673c49 100644 --- a/docs/sdks/overview.mdx +++ b/docs/sdks/overview.mdx @@ -36,31 +36,18 @@ From local development to production, Infisical SDKs provide the easiest way for - The client SDK caches every secret and implements a 5-minute waiting period before - re-requesting it. The waiting period can be controlled by setting the `cacheTTL` parameter at - the time of initializing the client. + The client SDK caches every secret and implements a 5-minute waiting period before re-requesting it. The waiting period can be controlled by + setting the `cacheTTL` parameter at the time of initializing the client. Note: The exact parameter name may differ depending on the language. - - Yes you can! The client SDK provides a method to attach the secrets to your process environment. - When using the `listSecrets()` method, you can pass a `attachToProcessEnv` parameter, which tells the SDK to attach all the found secrets to your process environment. + + Yes you can! The client SDK provides a method to attach the secrets to your process environment. When using the `listSecrets()` method, you + can pass a `attachToProcessEnv` parameter, which tells the SDK to attach all the found secrets to your process environment. Note: The exact parameter name may differ depending on the language. The SDK caches every secret and falls back to the cached value if a request fails. If no cached value is found, and the request fails, then the SDK throws an error. - - The token enables the SDK to authenticate with Infisical to fetch back your secrets. - Although the SDK requires you to pass in a token, it enables greater efficiency and security - than if you managed dozens of secrets yourself without it. Here're some benefits: - - - You always pull in the right secrets because they're fetched on demand from a centralize source that is Infisical. - - You can use the Infisical which comes with tons of benefits like secret versioning, access controls, audit logs, etc. - - You now risk leaking one token that can be revoked instead of dozens of raw secrets. - - And much more. - -