{"modulePath":"github.com/oapi-codegen/oapi-codegen-exp/v2","version":"v2.0.0-20260302174143-e87c2fbefce8","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package securityprovider\n\nPackage securityprovider contains some default securityprovider implementations, which can be used as a RequestEditorFn of a client.\n\n## Constants\n\n```go\nconst (\n\t// ErrSecurityProviderApiKeyInvalidIn indicates a usage of an invalid In.\n\t// Should be cookie, header or query\n\tErrSecurityProviderApiKeyInvalidIn = SecurityProviderError(\"invalid 'in' specified for apiKey\")\n)\n```\n\n## Types\n\n```go\ntype SecurityProviderApiKey struct {\n\t// contains filtered or unexported fields\n}\n```\nSecurityProviderApiKey will attach an apiKey either to a cookie, header or query.\n\n```go\nfunc NewSecurityProviderApiKey(in, name, apiKey string) (*SecurityProviderApiKey, error)\n```\nNewSecurityProviderApiKey will attach a generic apiKey for a given name either to a cookie, header or as a query parameter.\n\n```go\nfunc (s *SecurityProviderApiKey) Intercept(ctx context.Context, req *http.Request) error\n```\nIntercept will attach a cookie, header or query param for the configured name and apiKey.\n\n```go\ntype SecurityProviderBasicAuth struct {\n\t// contains filtered or unexported fields\n}\n```\nSecurityProviderBasicAuth sends a base64-encoded combination of username, password along with a request.\n\n```go\nfunc NewSecurityProviderBasicAuth(username, password string) (*SecurityProviderBasicAuth, error)\n```\nNewSecurityProviderBasicAuth provides a SecurityProvider, which can solve the BasicAuth challenge for api-calls.\n\n```go\nfunc (s *SecurityProviderBasicAuth) Intercept(ctx context.Context, req *http.Request) error\n```\nIntercept will attach an Authorization header to the request and ensures that the username, password are base64 encoded and attached to the header.\n\n```go\ntype SecurityProviderBearerToken struct {\n\t// contains filtered or unexported fields\n}\n```\nSecurityProviderBearerToken sends a token as part of an Authorization: Bearer header along with a request.\n\n```go\nfunc NewSecurityProviderBearerToken(token string) (*SecurityProviderBearerToken, error)\n```\nNewSecurityProviderBearerToken provides a SecurityProvider, which can solve the Bearer Auth challenge for api-calls.\n\n```go\nfunc (s *SecurityProviderBearerToken) Intercept(ctx context.Context, req *http.Request) error\n```\nIntercept will attach an Authorization header to the request and ensures that the bearer token is attached to the header.\n\n```go\ntype SecurityProviderError string\n```\nSecurityProviderError defines error values of a security provider.\n\n```go\nfunc (e SecurityProviderError) Error() string\n```\nError implements the error interface.\n\n","path":"github.com/oapi-codegen/oapi-codegen-exp/v2/pkg/securityprovider","name":"securityprovider","synopsis":"Package securityprovider contains some default securityprovider implementations, which can be used as a RequestEditorFn of a client.","isRedistributable":true}
