Documentation
¶
Overview ¶
Package authentication implements authentication mechanisms.
Key Transparency is designed to be used by identity providers - IdP in OAuth parlance. OAuth2 Access Tokens may be provided as authentication information, which can be resolved to user information and associated scopes on the backend.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // E2EScope authorizes a user to change their keys in the keyserver. E2EScope = "https://www.googleapis.com/auth/e2ekeys" // RequiredScopes is the set of scopes the server requires for a user to change keys. RequiredScopes = []string{gAPI.UserinfoEmailScope, E2EScope} )
Functions ¶
func FakeAuthFunc ¶
FakeAuthFunc implements go-grpc-middleware/auth.AuthFunc FakeAuthFunc looks for a fake authentication token and puts a SecurityContext in the returned ctx.
func GetFakeCredential ¶
func GetFakeCredential(userID string) credentials.PerRPCCredentials
GetFakeCredential returns fake PerRPCCredentials
Types ¶
type GAuth ¶
type GAuth struct {
// contains filtered or unexported fields
}
GAuth authenticates Google users through the Google TokenInfo API endpoint.
func NewGoogleAuth ¶
NewGoogleAuth creates a new authenticator for Google users.
type SecurityContext ¶
type SecurityContext struct {
Email string
}
SecurityContext is the auth value stored in the Contexts.
func FromContext ¶
func FromContext(ctx context.Context) (*SecurityContext, bool)
FromContext returns a SecurityContext from the current context. ValidatedSecurity is inserted into ctx by AuthFunc.