Repository navigation
Add Elixir SDK with precompiled NIFs #416
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
5c14d68
Add Elixir SDK with precompiled NIFs
sylvesterroos 59e78e2
Address PR #416 review findings for the Elixir SDK
sylvesterroos 9f3be59
Handle LastPass subprocess signals in Elixir SDK
sylvesterroos 7bbd2f7
Complete Elixir SDK integration
sylvesterroos 4ae73a6
Expand Elixir SDK conformance coverage and harden tests
sylvesterroos c5c97c2
Gate the Elixir SIGCHLD flip on subprocess-capable requests and unify
sylvesterroos 7ada2f4
Allow easy force-building
sylvesterroos 510dc48
Complete Elixir IPC v1 SDK migration
sylvesterroos de3dc08
Use newline framing in Elixir IPC client
sylvesterroos ec784d8
Fix Elixir resolver IPC negotiation
sylvesterroos d8f00bf
Fix Elixir IPC error handling and CI
sylvesterroos 479e8d5
Fix Elixir IPC session lifecycle and workflow
sylvesterroos 0628512
Harden resolver session lifecycle and deadlines
sylvesterroos 371a651
test: split Elixir SDK IPC coverage
sylvesterroos 158ea31
test: close IPC coverage gaps
sylvesterroos 736396a
test: cover coalesced IPC frames
sylvesterroos 95ad7d6
test: observe coalesced frame handling
sylvesterroos fb0ceda
Upgrade Elixir to 1.20
sylvesterroos 0acf1b0
Remove unused clause
sylvesterroos c4d2d67
Fix Elixir SDK IPC client review findings
sylvesterroos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: Elixir SDK | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "secretspec-ex/**" | ||
| - ".github/workflows/elixir-package.yml" | ||
| push: | ||
| tags: ["v**"] | ||
| workflow_call: | ||
| inputs: | ||
| pre_release: | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| package: | ||
| name: Build and test Elixir package | ||
| if: >- | ||
| inputs.pre_release || github.event_name != 'pull_request' || | ||
| !startsWith(github.event.pull_request.title, 'Release ') | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: erlef/setup-beam@v1 | ||
| with: | ||
| otp-version: "28" | ||
| elixir-version: "1.19" | ||
| - name: Install Rust | ||
| uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| - name: Install Hex and Rebar | ||
| run: | | ||
| mix local.hex --force | ||
| mix local.rebar --force | ||
| - name: Build SecretSpec CLI executable | ||
| run: cargo build --release --bin secretspec --features cli | ||
| - name: Fetch Elixir dependencies | ||
| working-directory: secretspec-ex | ||
| run: mix deps.get | ||
| - name: Check formatting | ||
| working-directory: secretspec-ex | ||
| run: mix format --check-formatted | ||
| - name: Run tests | ||
| working-directory: secretspec-ex | ||
| run: mix test | ||
| - name: Build docs | ||
| working-directory: secretspec-ex | ||
| run: mix docs | ||
| - name: Validate package | ||
| working-directory: secretspec-ex | ||
| run: mix hex.build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| --- | ||
| title: Elixir SDK | ||
| description: Resolve SecretSpec secrets from Elixir | ||
| --- | ||
|
|
||
| import VersionCompatibility from '@cachix/site-kit/ui/VersionCompatibility.astro'; | ||
|
|
||
| <VersionCompatibility version="0.21" /> | ||
|
|
||
| The Elixir SDK (`secretspec`, 0.21+) is a pure Elixir client for the `secretspec.resolver/1` IPC protocol. It requires a compatible `secretspec` executable (0.21+) and launches `secretspec serve` directly, without a shell, NIF, native archive, or Rust code in the Hex package. | ||
|
|
||
| ## Install | ||
|
|
||
| ```elixir | ||
| defp deps do | ||
| [{:secretspec, "~> 0.21"}] | ||
| end | ||
| ``` | ||
|
|
||
| Install SecretSpec separately and make `secretspec` available on `PATH`, or pass an explicit absolute `executable:` option. | ||
|
|
||
| ## Sessions | ||
|
|
||
| A session fixes the manifest, profile, scope, provider override, and reason for its lifetime. Resolution addresses one exact declared name at a time. | ||
|
|
||
| ```elixir | ||
| {:ok, session} = | ||
| SecretSpec.Session.start_link( | ||
| manifest: "/project/secretspec.toml", | ||
| profile: "production", | ||
| scope: "deploy", | ||
| reason: "start application" | ||
| ) | ||
|
|
||
| result = SecretSpec.Session.get(session, "DATABASE_URL", | ||
| representation: :value, | ||
| purpose: %{ | ||
| consumer: "my_app", | ||
| operation: "connect", | ||
| host: "db.example.com" | ||
| } | ||
| ) | ||
|
|
||
| SecretSpec.Session.close(session) | ||
| ``` | ||
|
|
||
| `representation` is `:auto`, `:value`, or `:path`. Path results are resolver-owned leases. Release them explicitly with `SecretSpec.Session.release/2`, or close the session to release all outstanding leases. | ||
|
|
||
| `purpose` must include non-empty `consumer` and `operation` fields. Optional `host` and `path` fields provide additional attribution. | ||
|
|
||
| ## Results | ||
|
|
||
| - `{:ok, %SecretSpec.Secret{}}` | ||
| - `{:missing, required}` | ||
| - `:undeclared` | ||
| - `{:error, %SecretSpec.Error{}}` | ||
|
|
||
| Use `SecretSpec.with_session/2` for scoped lifetimes: | ||
|
|
||
| ```elixir | ||
| SecretSpec.with_session([manifest: "/project/secretspec.toml"], fn session -> | ||
| SecretSpec.Session.get(session, "DATABASE_URL", purpose: %{consumer: "app", operation: "connect"}) | ||
| end) | ||
| ``` | ||
|
|
||
| Whole-profile resolution, reports, `SecretSpec.Builder`, and `abi_version/0` are not part of the resolver protocol. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.