go_micro_srv_auth_oauth2

package
v0.0.0-...-e2003b0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_oauth2_proto protoreflect.FileDescriptor

Functions

func NewOauth2Endpoints

func NewOauth2Endpoints() []*api.Endpoint

func RegisterOauth2Handler

func RegisterOauth2Handler(s server.Server, hdlr Oauth2Handler, opts ...server.HandlerOption) error

Types

type AuthorizeRequest

type AuthorizeRequest struct {

	// code, token (not supported)
	ResponseType string   `protobuf:"bytes,1,opt,name=response_type,json=responseType,proto3" json:"response_type,omitempty"`
	ClientId     string   `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	Scopes       []string `protobuf:"bytes,3,rep,name=scopes,proto3" json:"scopes,omitempty"`
	State        string   `protobuf:"bytes,4,opt,name=state,proto3" json:"state,omitempty"`
	RedirectUri  string   `protobuf:"bytes,5,opt,name=redirect_uri,json=redirectUri,proto3" json:"redirect_uri,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthorizeRequest) Descriptor deprecated

func (*AuthorizeRequest) Descriptor() ([]byte, []int)

Deprecated: Use AuthorizeRequest.ProtoReflect.Descriptor instead.

func (*AuthorizeRequest) GetClientId

func (x *AuthorizeRequest) GetClientId() string

func (*AuthorizeRequest) GetRedirectUri

func (x *AuthorizeRequest) GetRedirectUri() string

func (*AuthorizeRequest) GetResponseType

func (x *AuthorizeRequest) GetResponseType() string

func (*AuthorizeRequest) GetScopes

func (x *AuthorizeRequest) GetScopes() []string

func (*AuthorizeRequest) GetState

func (x *AuthorizeRequest) GetState() string

func (*AuthorizeRequest) ProtoMessage

func (*AuthorizeRequest) ProtoMessage()

func (*AuthorizeRequest) ProtoReflect

func (x *AuthorizeRequest) ProtoReflect() protoreflect.Message

func (*AuthorizeRequest) Reset

func (x *AuthorizeRequest) Reset()

func (*AuthorizeRequest) String

func (x *AuthorizeRequest) String() string

type AuthorizeResponse

type AuthorizeResponse struct {
	Code  string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	State string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"`
	// implicit response
	Token *Token `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthorizeResponse) Descriptor deprecated

func (*AuthorizeResponse) Descriptor() ([]byte, []int)

Deprecated: Use AuthorizeResponse.ProtoReflect.Descriptor instead.

func (*AuthorizeResponse) GetCode

func (x *AuthorizeResponse) GetCode() string

func (*AuthorizeResponse) GetState

func (x *AuthorizeResponse) GetState() string

func (*AuthorizeResponse) GetToken

func (x *AuthorizeResponse) GetToken() *Token

func (*AuthorizeResponse) ProtoMessage

func (*AuthorizeResponse) ProtoMessage()

func (*AuthorizeResponse) ProtoReflect

func (x *AuthorizeResponse) ProtoReflect() protoreflect.Message

func (*AuthorizeResponse) Reset

func (x *AuthorizeResponse) Reset()

func (*AuthorizeResponse) String

func (x *AuthorizeResponse) String() string

type IntrospectRequest

type IntrospectRequest struct {
	AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	// contains filtered or unexported fields
}

func (*IntrospectRequest) Descriptor deprecated

func (*IntrospectRequest) Descriptor() ([]byte, []int)

Deprecated: Use IntrospectRequest.ProtoReflect.Descriptor instead.

func (*IntrospectRequest) GetAccessToken

func (x *IntrospectRequest) GetAccessToken() string

func (*IntrospectRequest) ProtoMessage

func (*IntrospectRequest) ProtoMessage()

func (*IntrospectRequest) ProtoReflect

func (x *IntrospectRequest) ProtoReflect() protoreflect.Message

func (*IntrospectRequest) Reset

func (x *IntrospectRequest) Reset()

func (*IntrospectRequest) String

func (x *IntrospectRequest) String() string

type IntrospectResponse

type IntrospectResponse struct {
	Token  *Token `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	Active bool   `protobuf:"varint,2,opt,name=active,proto3" json:"active,omitempty"`
	// contains filtered or unexported fields
}

func (*IntrospectResponse) Descriptor deprecated

func (*IntrospectResponse) Descriptor() ([]byte, []int)

Deprecated: Use IntrospectResponse.ProtoReflect.Descriptor instead.

func (*IntrospectResponse) GetActive

func (x *IntrospectResponse) GetActive() bool

func (*IntrospectResponse) GetToken

func (x *IntrospectResponse) GetToken() *Token

func (*IntrospectResponse) ProtoMessage

func (*IntrospectResponse) ProtoMessage()

func (*IntrospectResponse) ProtoReflect

func (x *IntrospectResponse) ProtoReflect() protoreflect.Message

func (*IntrospectResponse) Reset

func (x *IntrospectResponse) Reset()

func (*IntrospectResponse) String

func (x *IntrospectResponse) String() string

type Oauth2Service

type Oauth2Service interface {
	Authorize(ctx context.Context, in *AuthorizeRequest, opts ...client.CallOption) (*AuthorizeResponse, error)
	Token(ctx context.Context, in *TokenRequest, opts ...client.CallOption) (*TokenResponse, error)
	Revoke(ctx context.Context, in *RevokeRequest, opts ...client.CallOption) (*RevokeResponse, error)
	Introspect(ctx context.Context, in *IntrospectRequest, opts ...client.CallOption) (*IntrospectResponse, error)
}

func NewOauth2Service

func NewOauth2Service(name string, c client.Client) Oauth2Service

type RevokeRequest

type RevokeRequest struct {

	// revoke access token
	AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	// revoke via refresh token
	RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	// contains filtered or unexported fields
}

func (*RevokeRequest) Descriptor deprecated

func (*RevokeRequest) Descriptor() ([]byte, []int)

Deprecated: Use RevokeRequest.ProtoReflect.Descriptor instead.

func (*RevokeRequest) GetAccessToken

func (x *RevokeRequest) GetAccessToken() string

func (*RevokeRequest) GetRefreshToken

func (x *RevokeRequest) GetRefreshToken() string

func (*RevokeRequest) ProtoMessage

func (*RevokeRequest) ProtoMessage()

func (*RevokeRequest) ProtoReflect

func (x *RevokeRequest) ProtoReflect() protoreflect.Message

func (*RevokeRequest) Reset

func (x *RevokeRequest) Reset()

func (*RevokeRequest) String

func (x *RevokeRequest) String() string

type RevokeResponse

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

func (*RevokeResponse) Descriptor deprecated

func (*RevokeResponse) Descriptor() ([]byte, []int)

Deprecated: Use RevokeResponse.ProtoReflect.Descriptor instead.

func (*RevokeResponse) ProtoMessage

func (*RevokeResponse) ProtoMessage()

func (*RevokeResponse) ProtoReflect

func (x *RevokeResponse) ProtoReflect() protoreflect.Message

func (*RevokeResponse) Reset

func (x *RevokeResponse) Reset()

func (*RevokeResponse) String

func (x *RevokeResponse) String() string

type Token

type Token struct {
	AccessToken  string   `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	TokenType    string   `protobuf:"bytes,2,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"`
	RefreshToken string   `protobuf:"bytes,3,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	ExpiresAt    int64    `protobuf:"varint,4,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"`
	Scopes       []string `protobuf:"bytes,5,rep,name=scopes,proto3" json:"scopes,omitempty"`
	// metadata associated with the token
	Metadata map[string]string `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Token) Descriptor deprecated

func (*Token) Descriptor() ([]byte, []int)

Deprecated: Use Token.ProtoReflect.Descriptor instead.

func (*Token) GetAccessToken

func (x *Token) GetAccessToken() string

func (*Token) GetExpiresAt

func (x *Token) GetExpiresAt() int64

func (*Token) GetMetadata

func (x *Token) GetMetadata() map[string]string

func (*Token) GetRefreshToken

func (x *Token) GetRefreshToken() string

func (*Token) GetScopes

func (x *Token) GetScopes() []string

func (*Token) GetTokenType

func (x *Token) GetTokenType() string

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) ProtoReflect

func (x *Token) ProtoReflect() protoreflect.Message

func (*Token) Reset

func (x *Token) Reset()

func (*Token) String

func (x *Token) String() string

type TokenRequest

type TokenRequest struct {
	ClientId     string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	ClientSecret string `protobuf:"bytes,2,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"`
	Code         string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"`
	// password (not supported), client_credentials, authorization_code, refresh_token
	GrantType    string `protobuf:"bytes,4,opt,name=grant_type,json=grantType,proto3" json:"grant_type,omitempty"`
	RedirectUri  string `protobuf:"bytes,5,opt,name=redirect_uri,json=redirectUri,proto3" json:"redirect_uri,omitempty"`
	RefreshToken string `protobuf:"bytes,6,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	// scopes can be added for client_credentials request
	Scopes []string `protobuf:"bytes,7,rep,name=scopes,proto3" json:"scopes,omitempty"`
	// metadata to be stored with a token that's generated
	Metadata map[string]string `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*TokenRequest) Descriptor deprecated

func (*TokenRequest) Descriptor() ([]byte, []int)

Deprecated: Use TokenRequest.ProtoReflect.Descriptor instead.

func (*TokenRequest) GetClientId

func (x *TokenRequest) GetClientId() string

func (*TokenRequest) GetClientSecret

func (x *TokenRequest) GetClientSecret() string

func (*TokenRequest) GetCode

func (x *TokenRequest) GetCode() string

func (*TokenRequest) GetGrantType

func (x *TokenRequest) GetGrantType() string

func (*TokenRequest) GetMetadata

func (x *TokenRequest) GetMetadata() map[string]string

func (*TokenRequest) GetRedirectUri

func (x *TokenRequest) GetRedirectUri() string

func (*TokenRequest) GetRefreshToken

func (x *TokenRequest) GetRefreshToken() string

func (*TokenRequest) GetScopes

func (x *TokenRequest) GetScopes() []string

func (*TokenRequest) ProtoMessage

func (*TokenRequest) ProtoMessage()

func (*TokenRequest) ProtoReflect

func (x *TokenRequest) ProtoReflect() protoreflect.Message

func (*TokenRequest) Reset

func (x *TokenRequest) Reset()

func (*TokenRequest) String

func (x *TokenRequest) String() string

type TokenResponse

type TokenResponse struct {
	Token *Token `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*TokenResponse) Descriptor deprecated

func (*TokenResponse) Descriptor() ([]byte, []int)

Deprecated: Use TokenResponse.ProtoReflect.Descriptor instead.

func (*TokenResponse) GetToken

func (x *TokenResponse) GetToken() *Token

func (*TokenResponse) ProtoMessage

func (*TokenResponse) ProtoMessage()

func (*TokenResponse) ProtoReflect

func (x *TokenResponse) ProtoReflect() protoreflect.Message

func (*TokenResponse) Reset

func (x *TokenResponse) Reset()

func (*TokenResponse) String

func (x *TokenResponse) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL