Documentation ¶
Overview ¶
Package go_micro_srv_auth_oauth2 is a generated protocol buffer package.
It is generated from these files:
oauth2.proto
It has these top-level messages:
Token AuthorizeRequest AuthorizeResponse TokenRequest TokenResponse RevokeRequest RevokeResponse ValidateRequest ValidateResponse
Index ¶
- func RegisterOauth2Handler(s server.Server, hdlr Oauth2Handler)
- type AuthorizeRequest
- type AuthorizeResponse
- type Oauth2
- func (h *Oauth2) Authorize(ctx context.Context, in *AuthorizeRequest, out *AuthorizeResponse) error
- func (h *Oauth2) Revoke(ctx context.Context, in *RevokeRequest, out *RevokeResponse) error
- func (h *Oauth2) Token(ctx context.Context, in *TokenRequest, out *TokenResponse) error
- func (h *Oauth2) Validate(ctx context.Context, in *ValidateRequest, out *ValidateResponse) error
- type Oauth2Client
- type Oauth2Handler
- type RevokeRequest
- type RevokeResponse
- type Token
- type TokenRequest
- type TokenResponse
- type ValidateRequest
- type ValidateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterOauth2Handler ¶
func RegisterOauth2Handler(s server.Server, hdlr Oauth2Handler)
Types ¶
type AuthorizeRequest ¶
type AuthorizeRequest struct { // code, token (not supported) ResponseType string `protobuf:"bytes,1,opt,name=response_type,json=responseType" json:"response_type,omitempty"` ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId" json:"client_id,omitempty"` Scopes []string `protobuf:"bytes,3,rep,name=scopes" json:"scopes,omitempty"` State string `protobuf:"bytes,4,opt,name=state" json:"state,omitempty"` RedirectUri string `protobuf:"bytes,5,opt,name=redirect_uri,json=redirectUri" json:"redirect_uri,omitempty"` }
func (*AuthorizeRequest) Descriptor ¶
func (*AuthorizeRequest) Descriptor() ([]byte, []int)
func (*AuthorizeRequest) ProtoMessage ¶
func (*AuthorizeRequest) ProtoMessage()
func (*AuthorizeRequest) Reset ¶
func (m *AuthorizeRequest) Reset()
func (*AuthorizeRequest) String ¶
func (m *AuthorizeRequest) String() string
type AuthorizeResponse ¶
type AuthorizeResponse struct { Code string `protobuf:"bytes,1,opt,name=code" json:"code,omitempty"` State string `protobuf:"bytes,2,opt,name=state" json:"state,omitempty"` // implicit response Token *Token `protobuf:"bytes,3,opt,name=token" json:"token,omitempty"` }
func (*AuthorizeResponse) Descriptor ¶
func (*AuthorizeResponse) Descriptor() ([]byte, []int)
func (*AuthorizeResponse) GetToken ¶
func (m *AuthorizeResponse) GetToken() *Token
func (*AuthorizeResponse) ProtoMessage ¶
func (*AuthorizeResponse) ProtoMessage()
func (*AuthorizeResponse) Reset ¶
func (m *AuthorizeResponse) Reset()
func (*AuthorizeResponse) String ¶
func (m *AuthorizeResponse) String() string
type Oauth2 ¶
type Oauth2 struct {
Oauth2Handler
}
func (*Oauth2) Authorize ¶
func (h *Oauth2) Authorize(ctx context.Context, in *AuthorizeRequest, out *AuthorizeResponse) error
func (*Oauth2) Revoke ¶
func (h *Oauth2) Revoke(ctx context.Context, in *RevokeRequest, out *RevokeResponse) error
func (*Oauth2) Token ¶
func (h *Oauth2) Token(ctx context.Context, in *TokenRequest, out *TokenResponse) error
func (*Oauth2) Validate ¶
func (h *Oauth2) Validate(ctx context.Context, in *ValidateRequest, out *ValidateResponse) error
type Oauth2Client ¶
type Oauth2Client 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) Validate(ctx context.Context, in *ValidateRequest, opts ...client.CallOption) (*ValidateResponse, error) }
func NewOauth2Client ¶
func NewOauth2Client(serviceName string, c client.Client) Oauth2Client
type Oauth2Handler ¶
type Oauth2Handler interface { Authorize(context.Context, *AuthorizeRequest, *AuthorizeResponse) error Token(context.Context, *TokenRequest, *TokenResponse) error Revoke(context.Context, *RevokeRequest, *RevokeResponse) error Validate(context.Context, *ValidateRequest, *ValidateResponse) error }
type RevokeRequest ¶
type RevokeRequest struct { // revoke access token AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"` // revoke via refresh token RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken" json:"refresh_token,omitempty"` }
func (*RevokeRequest) Descriptor ¶
func (*RevokeRequest) Descriptor() ([]byte, []int)
func (*RevokeRequest) ProtoMessage ¶
func (*RevokeRequest) ProtoMessage()
func (*RevokeRequest) Reset ¶
func (m *RevokeRequest) Reset()
func (*RevokeRequest) String ¶
func (m *RevokeRequest) String() string
type RevokeResponse ¶
type RevokeResponse struct { }
func (*RevokeResponse) Descriptor ¶
func (*RevokeResponse) Descriptor() ([]byte, []int)
func (*RevokeResponse) ProtoMessage ¶
func (*RevokeResponse) ProtoMessage()
func (*RevokeResponse) Reset ¶
func (m *RevokeResponse) Reset()
func (*RevokeResponse) String ¶
func (m *RevokeResponse) String() string
type Token ¶
type Token struct { AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"` TokenType string `protobuf:"bytes,2,opt,name=token_type,json=tokenType" json:"token_type,omitempty"` RefreshToken string `protobuf:"bytes,3,opt,name=refresh_token,json=refreshToken" json:"refresh_token,omitempty"` ExpiresAt int64 `protobuf:"varint,4,opt,name=expires_at,json=expiresAt" json:"expires_at,omitempty"` Scopes []string `protobuf:"bytes,5,rep,name=scopes" json:"scopes,omitempty"` // metadata associated with the token Metadata map[string]string `` /* 136-byte string literal not displayed */ }
func (*Token) Descriptor ¶
func (*Token) GetMetadata ¶
func (*Token) ProtoMessage ¶
func (*Token) ProtoMessage()
type TokenRequest ¶
type TokenRequest struct { ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId" json:"client_id,omitempty"` ClientSecret string `protobuf:"bytes,2,opt,name=client_secret,json=clientSecret" json:"client_secret,omitempty"` Code string `protobuf:"bytes,3,opt,name=code" json:"code,omitempty"` // password (not supported), client_credentials, authorization_code, refresh_token GrantType string `protobuf:"bytes,4,opt,name=grant_type,json=grantType" json:"grant_type,omitempty"` RedirectUri string `protobuf:"bytes,5,opt,name=redirect_uri,json=redirectUri" json:"redirect_uri,omitempty"` RefreshToken string `protobuf:"bytes,6,opt,name=refresh_token,json=refreshToken" json:"refresh_token,omitempty"` // scopes can be added for client_credentials request Scopes []string `protobuf:"bytes,7,rep,name=scopes" json:"scopes,omitempty"` // metadata to be stored with a token that's generated Metadata map[string]string `` /* 136-byte string literal not displayed */ }
func (*TokenRequest) Descriptor ¶
func (*TokenRequest) Descriptor() ([]byte, []int)
func (*TokenRequest) GetMetadata ¶
func (m *TokenRequest) GetMetadata() map[string]string
func (*TokenRequest) ProtoMessage ¶
func (*TokenRequest) ProtoMessage()
func (*TokenRequest) Reset ¶
func (m *TokenRequest) Reset()
func (*TokenRequest) String ¶
func (m *TokenRequest) String() string
type TokenResponse ¶
type TokenResponse struct {
Token *Token `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
}
func (*TokenResponse) Descriptor ¶
func (*TokenResponse) Descriptor() ([]byte, []int)
func (*TokenResponse) GetToken ¶
func (m *TokenResponse) GetToken() *Token
func (*TokenResponse) ProtoMessage ¶
func (*TokenResponse) ProtoMessage()
func (*TokenResponse) Reset ¶
func (m *TokenResponse) Reset()
func (*TokenResponse) String ¶
func (m *TokenResponse) String() string
type ValidateRequest ¶
type ValidateRequest struct {
AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"`
}
func (*ValidateRequest) Descriptor ¶
func (*ValidateRequest) Descriptor() ([]byte, []int)
func (*ValidateRequest) ProtoMessage ¶
func (*ValidateRequest) ProtoMessage()
func (*ValidateRequest) Reset ¶
func (m *ValidateRequest) Reset()
func (*ValidateRequest) String ¶
func (m *ValidateRequest) String() string
type ValidateResponse ¶
type ValidateResponse struct { Token *Token `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` Active bool `protobuf:"varint,2,opt,name=active" json:"active,omitempty"` }
func (*ValidateResponse) Descriptor ¶
func (*ValidateResponse) Descriptor() ([]byte, []int)
func (*ValidateResponse) GetToken ¶
func (m *ValidateResponse) GetToken() *Token
func (*ValidateResponse) ProtoMessage ¶
func (*ValidateResponse) ProtoMessage()
func (*ValidateResponse) Reset ¶
func (m *ValidateResponse) Reset()
func (*ValidateResponse) String ¶
func (m *ValidateResponse) String() string
Click to show internal directories.
Click to hide internal directories.