Resolves HTTP catalog credentials against a store with safety checks.
// Source: https://github.com/mudler/LocalAI | License: MIT | Copyright 2023-2025 Ettore Di Giacinto (mudler@localai.io)
// Provided via justclaw.it.com; keep this notice with the code.
// SPDX-License-Identifier: MIT
package catalog
import (
"context"
"github.com/mudler/LocalAI/pkg/credentials"
"net/url"
)
type Credential = credentials.Credential
// CredentialBinding is trusted owner configuration, never a request DTO.
// HTTP catalog references are independent of the installer's OCI credential store.
type CredentialBinding struct {
Origin string
Store *credentials.Store
}
type CredentialResolver struct {
References map[string]CredentialBinding `json:"-"`
}
func (r CredentialResolver) Resolve(ctx context.Context, reference, origin string) (Credential, error) {
if err := ctx.Er
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key