Add SMD integration service with caching and dynamic token support#14
Merged
Conversation
- 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>
…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>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request Template
Thank you for your contribution! Please ensure the following before submitting:
Checklist
make test(or equivalent) locally and all tests passgit commit -s) with my real name and email<filename>.licensesidecarLICENSES/directoryType of Change
For more info, see Contributing Guidelines.