Movatterモバイル変換


[0]ホーム

URL:


securityprovider

package
v2.5.0Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2025 License:Apache-2.0Imports:3Imported by:34

Details

Repository

github.com/oapi-codegen/oapi-codegen

Links

Documentation

Overview

Package securityprovider contains some default securityproviderimplementations, which can be used as a RequestEditorFn of aclient.

Index

Constants

View Source
const (// ErrSecurityProviderApiKeyInvalidIn indicates a usage of an invalid In.// Should be cookie, header or queryErrSecurityProviderApiKeyInvalidIn =SecurityProviderError("invalid 'in' specified for apiKey"))

Variables

This section is empty.

Functions

This section is empty.

Types

typeSecurityProviderApiKey

type SecurityProviderApiKey struct {// contains filtered or unexported fields}

SecurityProviderApiKey will attach an apiKey either to acookie, header or query.

funcNewSecurityProviderApiKey

func NewSecurityProviderApiKey(in, name, apiKeystring) (*SecurityProviderApiKey,error)

NewSecurityProviderApiKey will attach a generic apiKey for a given nameeither to a cookie, header or as a query parameter.

func (*SecurityProviderApiKey)Intercept

Intercept will attach a cookie, header or query param for the configuredname and apiKey.

typeSecurityProviderBasicAuth

type SecurityProviderBasicAuth struct {// contains filtered or unexported fields}

SecurityProviderBasicAuth sends a base64-encoded combination ofusername, password along with a request.

funcNewSecurityProviderBasicAuth

func NewSecurityProviderBasicAuth(username, passwordstring) (*SecurityProviderBasicAuth,error)

NewSecurityProviderBasicAuth provides a SecurityProvider, which can solvethe BasicAuth challenge for api-calls.

func (*SecurityProviderBasicAuth)Intercept

Intercept will attach an Authorization header to the request and ensures thatthe username, password are base64 encoded and attached to the header.

typeSecurityProviderBearerToken

type SecurityProviderBearerToken struct {// contains filtered or unexported fields}

SecurityProviderBearerToken sends a token as part of anAuthorization: Bearer header along with a request.

funcNewSecurityProviderBearerToken

func NewSecurityProviderBearerToken(tokenstring) (*SecurityProviderBearerToken,error)

NewSecurityProviderBearerToken provides a SecurityProvider, which can solvethe Bearer Auth challenge for api-calls.

func (*SecurityProviderBearerToken)Intercept

Intercept will attach an Authorization header to the requestand ensures that the bearer token is attached to the header.

typeSecurityProviderError

type SecurityProviderErrorstring

SecurityProviderError defines error values of a security provider.

func (SecurityProviderError)Error

Error implements the error interface.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp