Documentation
¶
Overview ¶
SPDX-FileCopyrightText: (C) 2025 Intel Corporation SPDX-License-Identifier: Apache-2.0
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTestJWT ¶
CreateTestJWT creates a JWT token for testing with specified expiration and roles
func ExtractTokenTTL ¶
ExtractTokenTTL extracts the TTL from a JWT token for testing
Types ¶
type MockKeycloakServer ¶
type MockKeycloakServer struct {
Server *httptest.Server
TokenTTL time.Duration
UserRoles []string
}
MockKeycloakServer provides a mock Keycloak server for testing
func NewMockKeycloakServer ¶
func NewMockKeycloakServer() *MockKeycloakServer
func (*MockKeycloakServer) Close ¶
func (m *MockKeycloakServer) Close()
func (*MockKeycloakServer) SetTokenTTL ¶
func (m *MockKeycloakServer) SetTokenTTL(ttl time.Duration)
func (*MockKeycloakServer) SetUserRoles ¶
func (m *MockKeycloakServer) SetUserRoles(roles []string)
func (*MockKeycloakServer) URL ¶
func (m *MockKeycloakServer) URL() string
type MockVaultAuth ¶
type MockVaultAuth struct {
ClientID string
ClientSecret string
ShouldFail bool
FailMessage string
}
MockVaultAuth implements VaultAuth interface for testing
func NewMockVaultAuth ¶
func NewMockVaultAuth(clientID, clientSecret string) *MockVaultAuth
func (*MockVaultAuth) GetClientCredentials ¶
func (*MockVaultAuth) SetFailure ¶
func (m *MockVaultAuth) SetFailure(shouldFail bool, message string)
Click to show internal directories.
Click to hide internal directories.