Documentation
¶
Index ¶
- func NewClient(auth AuthInterceptor, addr string) (proto.TokenClient, func(), error)
- type AuthInterceptor
- type Config
- func (c *Config) RetrieveToken() (*oauth2.Token, error)
- func (c *Config) RevokeToken() error
- func (c *Config) StoreToken(token *oauth2.Token) error
- func (c *Config) TokenSource(ctx context.Context, t *oauth2.Token) oauth2.TokenSource
- func (c *Config) TokenSourceFrom(ctx context.Context) oauth2.TokenSource
- type DuneBotTokenSource
- type Endpoint
- type MockOAuth2Server
- type OAuth2Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(auth AuthInterceptor, addr string) (proto.TokenClient, func(), error)
Types ¶
type AuthInterceptor ¶
type AuthInterceptor struct {
// contains filtered or unexported fields
}
GRPC Authentication Interceptor
Inspired by the following tutorial https://dev.to/techschoolguru/use-grpc-interceptor-for-authorization-with-jwt-1c5h
func NewAuthInterceptor ¶
func NewAuthInterceptor(accessTokenFnc func() string) *AuthInterceptor
func (*AuthInterceptor) Stream ¶
func (interceptor *AuthInterceptor) Stream() grpc.StreamClientInterceptor
func (*AuthInterceptor) Unary ¶
func (interceptor *AuthInterceptor) Unary() grpc.UnaryClientInterceptor
type Config ¶
type Config struct { Ctx context.Context InstallationId string User string Addr string *OAuth2Config AuthInterceptor }
func (*Config) RevokeToken ¶
func (*Config) TokenSource ¶
func (*Config) TokenSourceFrom ¶
func (c *Config) TokenSourceFrom(ctx context.Context) oauth2.TokenSource
type DuneBotTokenSource ¶
type DuneBotTokenSource struct {
// contains filtered or unexported fields
}
type MockOAuth2Server ¶
func NewMockOAuth2Server ¶
func NewMockOAuth2Server() *MockOAuth2Server
func (*MockOAuth2Server) Close ¶
func (m *MockOAuth2Server) Close()
func (*MockOAuth2Server) Endpoint ¶
func (m *MockOAuth2Server) Endpoint() oauth2.Endpoint
type OAuth2Config ¶
Click to show internal directories.
Click to hide internal directories.