Skip to content

Add SMD integration service with caching and dynamic token support#14

Merged
alexlovelltroy merged 9 commits into
mainfrom
bugfix/smd-refresh
May 20, 2026
Merged

Add SMD integration service with caching and dynamic token support#14
alexlovelltroy merged 9 commits into
mainfrom
bugfix/smd-refresh

Conversation

@alexlovelltroy
Copy link
Copy Markdown
Member

  • Implemented SMDIntegrationService for cache-backed SMD operations with background synchronization.
  • Introduced dynamic token provider in HTTPClient to support token retrieval at runtime.
  • Added tests for SMD integration service, including initial and periodic sync, cache fallback, and group membership updates.
  • Enhanced mock SMD client to support component listing for testing.
  • Updated interfaces to include ComponentLister and ComponentResolver for better abstraction.
  • Added new test cases to validate the behavior of the integration service under various scenarios.

Pull Request Template

Thank you for your contribution! Please ensure the following before submitting:

Checklist

  • My code follows the style guidelines of this project
  • I have added/updated comments where needed
  • I have added tests that prove my fix is effective or my feature works
  • I have run make test (or equivalent) locally and all tests pass
  • DCO Sign-off: All commits are signed off (git commit -s) with my real name and email
  • REUSE Compliance:
    • Each new/modified source file has SPDX copyright and license headers
    • Any non-commentable files include a <filename>.license sidecar
    • All referenced licenses are present in the LICENSES/ directory

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

For more info, see Contributing Guidelines.

- Implemented SMDIntegrationService for cache-backed SMD operations with background synchronization.
- Introduced dynamic token provider in HTTPClient to support token retrieval at runtime.
- Added tests for SMD integration service, including initial and periodic sync, cache fallback, and group membership updates.
- Enhanced mock SMD client to support component listing for testing.
- Updated interfaces to include ComponentLister and ComponentResolver for better abstraction.
- Added new test cases to validate the behavior of the integration service under various scenarios.

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
- Refactor initSMDClient to support dynamic authentication using TokenSmith.
- Introduce ServiceTokenManager for managing service tokens and their lifecycle.
- Implement error handling for missing bootstrap tokens in dynamic mode.
- Update HTTPClient to use dynamic tokens when available.
- Add tests for ServiceTokenManager to validate token retrieval and refresh logic.
- Introduce new utility functions for configuration management and scope parsing.
- Update go.mod and go.sum to include tokensmith dependency and other updates.

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
…t coverage for component ID resolution

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
- Introduced functions for notifying and stopping shutdown signals in main.go.
- Updated runServer to use the new signal handling functions.
- Added a new test file main_runtime_test.go to validate configuration loading, health handler response, and server shutdown behavior.
- Implemented tests for WireGuard routes in wireguard_routes_test.go, including group membership handling and client IP resolution.
- Enhanced documentation in doc.go and pkg/handlers/doc.go to clarify endpoint behaviors and request flows.
- Updated smdclient tests to support new group membership response shapes and validate Ethernet NIC info caching.

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
…nfiguration

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
…sponse with initial sync status

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
@alexlovelltroy alexlovelltroy marked this pull request as draft May 16, 2026 10:58
…ndling

- Added support for mTLS identity authentication in the ServiceTokenManager.
- Introduced new TokenAuthMethod constants for bootstrap token and mTLS identity.
- Updated TokenExchangeConfig to include service identity certificate, key, and CA paths.
- Implemented logic to select authentication method based on available identity material.
- Enhanced error handling for token refresh and session exchange failures.
- Added tests for mTLS identity session and refresh, including scenarios for unreadable identity material.
- Improved existing tests to cover new authentication flows and error conditions.

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
… tests

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
@alexlovelltroy alexlovelltroy marked this pull request as ready for review May 20, 2026 21:40
@alexlovelltroy alexlovelltroy merged commit 4dd5a2e into main May 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant