Skip to content

feat: Add OpenStack Barbican support as a Key Source#2030

Open
devx wants to merge 2 commits intogetsops:mainfrom
devx:barbican-support
Open

feat: Add OpenStack Barbican support as a Key Source#2030
devx wants to merge 2 commits intogetsops:mainfrom
devx:barbican-support

Conversation

@devx
Copy link
Copy Markdown

@devx devx commented Dec 30, 2025

This PR integrates OpenStack Barbican as a supported backend for key management. It allows the keyservice to authenticate with and retrieve secrets directly from a Barbican instance, expanding our integration capabilities beyond the current stores.

Key Changes

  • Barbican Implementation: Added BarbicanKeySource with full authentication (Keystone) and client logic.
  • Integration: Wired Barbican support into the core keyservice and store interfaces.
  • Configuration: Updated the configuration system to accept Barbican endpoints, project IDs, and credentials.
  • Safety: Implemented fallback logic and error handling to ensure backward compatibility with existing key sources.

Testing I have added a comprehensive test suite to ensure reliability:

  • Unit Tests: Coverage for the new client and auth logic.
  • Integration Tests: Verified against a live/mocked Barbican endpoint.
  • Property-Based Tests: Added fuzzing/property tests to handle edge cases in key retrieval and parsing.

This also resolves issue #1651

@felixfontein
Copy link
Copy Markdown
Contributor

Thanks for your work! Unfortunately I think this is quite out of scope for the SOPS codebase, since it contains a complete Barbican client implementation. This is nothing we want to maintain here.

I think the best way forward for this is #2016 (which unfortunately isn't anywhere near realization).

@devx devx force-pushed the barbican-support branch from df76baa to 020c9c9 Compare March 26, 2026 23:18
devx added 2 commits March 26, 2026 18:22
- Implement Barbican key source with authentication and client functionality
- Add comprehensive test suite including unit, integration, and property-based tests
- Update configuration system to support Barbican endpoints and authentication
- Integrate Barbican support into keyservice and stores
- Add documentation and usage examples for Barbican configuration
- Ensure backward compatibility and proper error handling

Signed-off-by: Victor Palma <palma.victor@gmail.com>
- doRequestWithRetry now checks ctx.Err() before wrapping the final
  error, so callers see a context cancellation instead of a generic
  'maximum retry attempts' API error.
- TestEncryptMultiRegion guards shared secretStores/secretCounters
  maps with a sync.Mutex to eliminate the data race detected by
  -race.

Signed-off-by: Victor Palma <palma.victor@gmail.com>
@devx devx force-pushed the barbican-support branch from 020c9c9 to d9e3429 Compare March 26, 2026 23:23
@devx
Copy link
Copy Markdown
Author

devx commented Mar 26, 2026

Thank you for the feedback. I'll look at #2016 and see how I can help with that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants