Documentation ¶
Index ¶
- func AuthSessionCodeChallenge(codeVerifier string) string
- func AuthSessionCodeVerifierAndChallenge() (string, string, error)
- func HelperGenerateTokenIssuerSecrets(t *testing.T) ([]byte, ed25519.PublicKey, ed25519.PrivateKey)
- func IssueRandomToken(issuer *AuthTokenIssuer, services map[string]string) (string, error)
- type AuthSession
- type AuthTokenIssuer
- type AuthTokenOptions
- type AuthTokenServer
- type AuthTokenVerifier
- func (r *AuthTokenVerifier) GRPCAuthInterceptor(serviceID string) func(ctx context.Context) (context.Context, error)
- func (r *AuthTokenVerifier) VerifyCode(code, codeVerifier string) (*protocoltypes.ServicesTokenCode, error)
- func (r *AuthTokenVerifier) VerifyToken(token, serviceID string) (*protocoltypes.ServicesTokenCode, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IssueRandomToken ¶
func IssueRandomToken(issuer *AuthTokenIssuer, services map[string]string) (string, error)
Types ¶
type AuthSession ¶
type AuthSession struct { State string CodeVerifier string // CodeVerifier base64 encoded random value BaseURL string }
func NewAuthSession ¶
func NewAuthSession(baseURL string) (*AuthSession, string, error)
type AuthTokenIssuer ¶
type AuthTokenIssuer struct { *AuthTokenVerifier // contains filtered or unexported fields }
func NewAuthTokenIssuer ¶
func NewAuthTokenIssuer(secret []byte, sk ed25519.PrivateKey) (*AuthTokenIssuer, error)
func (*AuthTokenIssuer) IssueCode ¶
func (r *AuthTokenIssuer) IssueCode(codeChallenge string, services []string) (string, error)
func (*AuthTokenIssuer) IssueToken ¶
func (r *AuthTokenIssuer) IssueToken(services []string) (string, error)
type AuthTokenOptions ¶
type AuthTokenServer ¶
type AuthTokenServer struct {
// contains filtered or unexported fields
}
func NewAuthTokenServer ¶
func NewAuthTokenServer(secret []byte, sk ed25519.PrivateKey, services map[string]string, opts *AuthTokenOptions) (*AuthTokenServer, error)
func (*AuthTokenServer) IssueRandomTokenForServices ¶
func (a *AuthTokenServer) IssueRandomTokenForServices() (string, error)
func (*AuthTokenServer) ServeHTTP ¶
func (a *AuthTokenServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
type AuthTokenVerifier ¶
type AuthTokenVerifier struct {
// contains filtered or unexported fields
}
func NewAuthTokenVerifier ¶
func NewAuthTokenVerifier(secret []byte, pk ed25519.PublicKey) (*AuthTokenVerifier, error)
func (*AuthTokenVerifier) GRPCAuthInterceptor ¶
func (*AuthTokenVerifier) VerifyCode ¶
func (r *AuthTokenVerifier) VerifyCode(code, codeVerifier string) (*protocoltypes.ServicesTokenCode, error)
func (*AuthTokenVerifier) VerifyToken ¶
func (r *AuthTokenVerifier) VerifyToken(token, serviceID string) (*protocoltypes.ServicesTokenCode, error)
Click to show internal directories.
Click to hide internal directories.