Documentation ¶
Index ¶
Constants ¶
const ( // rfc2617 (e.g. Authorization: basic token, Authorization: bearer token) AuthorizationHeader = "authorization" Basic = "basic" Bearer = "bearer" )
const (
UserCtxName = "user"
)
Variables ¶
This section is empty.
Functions ¶
func JWTAuthHeaderForGRPC ¶
JWTAuthHeaderForGRPC returns JWT Auth Header for GRPC.
Types ¶
type AwsIamConfig ¶
type AwsIamConfig struct { ClientAccessKey string ClientSecretAccessKey string ServerAllowUsers []string // allow users ServerAccountId string // server allow users }
func (*AwsIamConfig) ClientAuth ¶ added in v1.3.0
func (c *AwsIamConfig) ClientAuth() (ClientAuthMethod, bool)
ClientAuth is returns ClientAuthMethod for AWS IAM.
func (*AwsIamConfig) ServerAuth ¶ added in v1.3.0
func (c *AwsIamConfig) ServerAuth() (ServerAuthMethod, bool)
ServerAuth returns ServerAuthMethod and bool value(whether exist or not).
type ClientManager ¶ added in v1.3.0
type ClientManager interface {
ClientAuth() (ClientAuthMethod, bool)
}
func NewClientManagerForAwsIAM ¶ added in v1.3.0
func NewClientManagerForAwsIAM(accessKey, accessSecret string) (ClientManager, error)
NewClientManagerForAwsIAM returns ClientManager implementing awsIam.
func NewClientManagerForGoogleOpenID ¶ added in v1.3.0
func NewClientManagerForGoogleOpenID(clientId, clientSecret string) (ClientManager, error)
NewClientManagerForGoogleOpenID returns ClientManager implementing googleOpenId.
func NewClientManagerForTest ¶ added in v1.3.0
func NewClientManagerForTest() (ClientManager, error)
NewClientManagerForTest returns ClientManager implementing googleOpenId.
type GoogleOpenIDConfig ¶
type GoogleOpenIDConfig struct { ClientId string // google client id ClientSecret string // google secret HD string // gsuite domain (only vpn-server) AllowEmails []string // allow emails (only vpn-server) }
https://developers.google.com/identity/protocols/oauth2/native-app https://developers.google.com/identity/protocols/oauth2/openid-connect
func (*GoogleOpenIDConfig) ClientAuth ¶ added in v1.3.0
func (c *GoogleOpenIDConfig) ClientAuth() (ClientAuthMethod, bool)
ClientAuth is returns ClientAuthMethod for Google Open ID.
func (*GoogleOpenIDConfig) ServerAuth ¶ added in v1.3.0
func (c *GoogleOpenIDConfig) ServerAuth() (ServerAuthMethod, bool)
ServerAuth returns ServerAuthMethod and bool value(whether exist or not).
type ServerAuthMethod ¶ added in v1.3.0
type ServerAuthMethod grpc.UnaryServerInterceptor
type ServerManager ¶ added in v1.3.0
type ServerManager interface {
ServerAuth() (ServerAuthMethod, bool)
}
func NewServerManagerForAwsIAM ¶ added in v1.3.0
func NewServerManagerForAwsIAM(accountId string, allowUsers []string) (ServerManager, error)
NewServerManagerForAwsIAM returns ServerManager implementing awsIam.
func NewServerManagerForGoogleOpenID ¶ added in v1.3.0
func NewServerManagerForGoogleOpenID(clientId, clientSecret, hd string, allowEmails []string) (ServerManager, error)
NewServerManagerForGoogleOpenID returns ServerManager implementing googleOpenI
func NewServerManagerForTest ¶ added in v1.3.0
func NewServerManagerForTest() (ServerManager, error)
NewServerManagerForTest returns ServerManager implementing googleOpenI