-
Notifications
You must be signed in to change notification settings - Fork 92
Add support for Infisical #857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@v0ctor DCO issue. |
pkg/providers/infisical/infisical.go
Outdated
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return err
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed! Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for Infisical, a secrets management platform, as a new provider in vals. The integration uses the official Infisical Go SDK and supports multiple authentication methods (Universal Auth, Kubernetes, AWS IAM, Azure, GCP IAM, and GCP ID Token), making it compatible with the official Ansible integration for users who use both tools.
Key changes:
- Adds a new
infisicalprovider with support for retrieving secrets via the Infisical Go SDK - Integrates the provider into the vals runtime, string provider, and string map provider systems
- Adds comprehensive documentation for authentication methods and usage examples
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| vals.go | Registers the Infisical provider in the main runtime |
| pkg/stringprovider/stringprovider.go | Adds Infisical to the string provider factory |
| pkg/stringmapprovider/stringmapprovider.go | Adds Infisical to the string map provider factory |
| pkg/providers/infisical/infisical.go | Implements the complete Infisical provider with authentication and secret retrieval |
| go.mod | Adds the Infisical Go SDK dependency (v0.5.100) and related transitive dependencies |
| README.md | Documents the Infisical provider with environment variables, parameters, examples, and authentication methods |
| path := cfg.String("path") | ||
|
|
||
| if path != "" { | ||
| p.path = "/" + path | ||
| } |
Copilot
AI
Oct 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path handling adds a leading slash unconditionally, which could result in double slashes if the user already provides a path with a leading slash (e.g., '/prometheus' becomes '//prometheus'). Consider trimming leading slashes from the input before adding one: p.path = '/' + strings.TrimPrefix(path, '/') or only add the slash if it's missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Legit. Fixed.
pkg/providers/infisical/infisical.go
Outdated
| p.version, _ = strconv.Atoi( | ||
| cfg.String("version"), | ||
| ) |
Copilot
AI
Oct 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Silent failure when parsing the version could mask configuration errors. If an invalid version string is provided, it silently defaults to 0 without informing the user. Consider logging a warning when the version fails to parse, or return an error from the New function if version parsing is critical.
| p.version, _ = strconv.Atoi( | |
| cfg.String("version"), | |
| ) | |
| versionStr := cfg.String("version") | |
| versionInt, err := strconv.Atoi(versionStr) | |
| if versionStr != "" && err != nil { | |
| l.Warnf("Invalid version string '%s', defaulting to 0: %v", versionStr, err) | |
| p.version = 0 | |
| } else { | |
| p.version = versionInt | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Legit. Fixed.
README.md
Outdated
|
|
||
| Examples: | ||
|
|
||
| - `ref+infisical://WEBHOOK_URL?project=infrastructure-hue8&path=prometheus&environment=prod`: gets the secret at "infrastructure" (project slug) -> "prometheus" (folder) -> "WEBHOOK_URL" (secret) -> "prod" (environment). |
Copilot
AI
Oct 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example description states the project slug is 'infrastructure' but the URL parameter shows 'infrastructure-hue8'. This inconsistency could confuse users. Either update the parameter to match the description or update the description to accurately reflect the parameter value.
| - `ref+infisical://WEBHOOK_URL?project=infrastructure-hue8&path=prometheus&environment=prod`: gets the secret at "infrastructure" (project slug) -> "prometheus" (folder) -> "WEBHOOK_URL" (secret) -> "prod" (environment). | |
| - `ref+infisical://WEBHOOK_URL?project=infrastructure-hue8&path=prometheus&environment=prod`: gets the secret at "infrastructure-hue8" (project slug) -> "prometheus" (folder) -> "WEBHOOK_URL" (secret) -> "prod" (environment). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Legit. Fixed.
README.md
Outdated
|
|
||
| Depending on which one is chosen with the `INFISICAL_AUTH_METHOD` environment variable, the following environment variables must also be provided. | ||
|
|
||
| - **Universal**:`UNIVERSAL_AUTH` |
Copilot
AI
Oct 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after the colon. Should be 'Universal: UNIVERSAL_AUTH' for consistency with the other authentication method entries.
| - **Universal**:`UNIVERSAL_AUTH` | |
| - **Universal**: `UNIVERSAL_AUTH` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Legit. Fixed.
db9d47c to
bd89494
Compare
Signed-off-by: Víctor Díaz Marco <[email protected]>
Signed-off-by: Víctor Díaz Marco <[email protected]>
Signed-off-by: Víctor Díaz Marco <[email protected]>
Signed-off-by: Víctor Díaz Marco <[email protected]>
Signed-off-by: Víctor Díaz Marco <[email protected]>
bd89494 to
6b9b459
Compare
|
All issues fixed! |
This PR adds support for Infisical, either the SaaS or a self-deployment.
By using the official SDK, the same environment variables also work for the official Ansible integration, which makes it very convenient for those who use both tools together for IaC.