Documentation
¶
Overview ¶
* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- type Config
- type CredentialManager
- type DataStoreType
- type InMemoryCredentialManager
- func (m *InMemoryCredentialManager) Delete(ctx context.Context, mac net.HardwareAddr) error
- func (m *InMemoryCredentialManager) Get(ctx context.Context, mac net.HardwareAddr) (*credential.Credential, error)
- func (m *InMemoryCredentialManager) Keys(ctx context.Context) ([]net.HardwareAddr, error)
- func (m *InMemoryCredentialManager) Patch(ctx context.Context, mac net.HardwareAddr, cred *credential.Credential) error
- func (m *InMemoryCredentialManager) Put(ctx context.Context, mac net.HardwareAddr, cred *credential.Credential) error
- func (m *InMemoryCredentialManager) Start(ctx context.Context) error
- func (m *InMemoryCredentialManager) Stop(ctx context.Context) error
- type VaultConfig
- type VaultCredentialManager
- func (m *VaultCredentialManager) Delete(ctx context.Context, mac net.HardwareAddr) error
- func (m *VaultCredentialManager) Get(ctx context.Context, mac net.HardwareAddr) (*credential.Credential, error)
- func (m *VaultCredentialManager) Keys(ctx context.Context) ([]net.HardwareAddr, error)
- func (m *VaultCredentialManager) Patch(ctx context.Context, mac net.HardwareAddr, cred *credential.Credential) error
- func (m *VaultCredentialManager) Put(ctx context.Context, mac net.HardwareAddr, cred *credential.Credential) error
- func (m *VaultCredentialManager) Start(ctx context.Context) error
- func (m *VaultCredentialManager) Stop(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
DataStoreType DataStoreType
VaultConfig *VaultConfig
}
Config holds the selected backend and provider config (Vault).
type CredentialManager ¶
type CredentialManager interface {
Start(ctx context.Context) error
Stop(ctx context.Context) error
Get(ctx context.Context, mac net.HardwareAddr) (*credential.Credential, error)
Put(ctx context.Context, mac net.HardwareAddr, credentials *credential.Credential) error
Patch(ctx context.Context, mac net.HardwareAddr, credentials *credential.Credential) error
Delete(ctx context.Context, mac net.HardwareAddr) error
Keys(ctx context.Context) ([]net.HardwareAddr, error)
}
CredentialManager defines a key-value store for PMC credentials keyed by MAC address.
type DataStoreType ¶
type DataStoreType string
DataStoreType selects credential store backend.
const ( DatastoreTypeVault DataStoreType = "Vault" DatastoreTypeInMemory DataStoreType = "InMemory" )
type InMemoryCredentialManager ¶
type InMemoryCredentialManager struct {
// contains filtered or unexported fields
}
InMemoryCredentialManager implements the CredentialManager interface with an in-memory store.
func NewInMemoryCredentialManager ¶
func NewInMemoryCredentialManager() *InMemoryCredentialManager
func (*InMemoryCredentialManager) Delete ¶
func (m *InMemoryCredentialManager) Delete(ctx context.Context, mac net.HardwareAddr) error
Delete removes the credential for mac (no error if absent).
func (*InMemoryCredentialManager) Get ¶
func (m *InMemoryCredentialManager) Get(ctx context.Context, mac net.HardwareAddr) (*credential.Credential, error)
Get returns the credential for mac or an error if missing/invalid.
func (*InMemoryCredentialManager) Keys ¶
func (m *InMemoryCredentialManager) Keys(ctx context.Context) ([]net.HardwareAddr, error)
Keys returns all MACs with stored credentials.
func (*InMemoryCredentialManager) Patch ¶
func (m *InMemoryCredentialManager) Patch(ctx context.Context, mac net.HardwareAddr, cred *credential.Credential) error
Patch updates the credential for mac (replaces current value).
func (*InMemoryCredentialManager) Put ¶
func (m *InMemoryCredentialManager) Put(ctx context.Context, mac net.HardwareAddr, cred *credential.Credential) error
Put stores or replaces the credential for mac.
type VaultConfig ¶
VaultConfig configures access to Vault (address and token). The token should be scoped minimally for KV operations.
func (*VaultConfig) NewManager ¶
func (c *VaultConfig) NewManager() (*VaultCredentialManager, error)
NewManager initializes a Vault client with the configured address and token. TLS verification is skipped to handle self-signed certificates in Kubernetes environments.
func (VaultConfig) String ¶
func (c VaultConfig) String() string
String returns the canonical string form of the version.
func (*VaultConfig) Validate ¶
func (c *VaultConfig) Validate() error
Validate ensures required Vault fields are provided.
type VaultCredentialManager ¶
type VaultCredentialManager struct {
// contains filtered or unexported fields
}
VaultCredentialManager implements the CredentialManager interface with a Vault store.
func (*VaultCredentialManager) Delete ¶
func (m *VaultCredentialManager) Delete(ctx context.Context, mac net.HardwareAddr) error
Delete removes the credential specified by the PMC mac (if it exists) from Vault.
func (*VaultCredentialManager) Get ¶
func (m *VaultCredentialManager) Get(ctx context.Context, mac net.HardwareAddr) (*credential.Credential, error)
Get retrieves and validates credentials for the given MAC from Vault.
func (*VaultCredentialManager) Keys ¶
func (m *VaultCredentialManager) Keys(ctx context.Context) ([]net.HardwareAddr, error)
Keys returns a list of PMC MACs for which credential manager has secrets for.
func (*VaultCredentialManager) Patch ¶
func (m *VaultCredentialManager) Patch(ctx context.Context, mac net.HardwareAddr, cred *credential.Credential) error
Patch replaces the PMC's credentials in Vault (equivalent to Put).
func (*VaultCredentialManager) Put ¶
func (m *VaultCredentialManager) Put(ctx context.Context, mac net.HardwareAddr, cred *credential.Credential) error
Put writes the credentials of a given PMC (specified by MAC) to Vault.