Documentation
¶
Index ¶
- type JWTClaims
- type Service
- func (s *Service) Base58Decode(input string) ([]byte, error)
- func (s *Service) CreateNonce(ctx context.Context, wallet, purpose, namespace string) (string, error)
- func (s *Service) GenerateJWT(ns, subject string, ttl time.Duration) (string, int64, error)
- func (s *Service) GetOrCreateAPIKey(ctx context.Context, wallet, namespace string) (string, error)
- func (s *Service) IssueTokens(ctx context.Context, wallet, namespace string) (string, string, int64, error)
- func (s *Service) JWKSHandler(w http.ResponseWriter, r *http.Request)
- func (s *Service) ParseAndVerifyJWT(token string) (*JWTClaims, error)
- func (s *Service) RefreshToken(ctx context.Context, refreshToken, namespace string) (string, string, int64, error)
- func (s *Service) RegisterApp(ctx context.Context, wallet, namespace, name, publicKey string) (string, error)
- func (s *Service) ResolveNamespaceID(ctx context.Context, ns string) (interface{}, error)
- func (s *Service) RevokeToken(ctx context.Context, namespace, token string, all bool, subject string) error
- func (s *Service) VerifySignature(ctx context.Context, wallet, nonce, signature, chainType string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles authentication business logic
func NewService ¶
func NewService(logger *logging.ColoredLogger, orm client.NetworkClient, signingKeyPEM string, defaultNS string) (*Service, error)
func (*Service) Base58Decode ¶
Base58Decode decodes a base58-encoded string
func (*Service) CreateNonce ¶
func (s *Service) CreateNonce(ctx context.Context, wallet, purpose, namespace string) (string, error)
CreateNonce generates a new nonce and stores it in the database
func (*Service) GenerateJWT ¶
func (*Service) GetOrCreateAPIKey ¶
GetOrCreateAPIKey returns an existing API key or creates a new one for a wallet in a namespace
func (*Service) IssueTokens ¶
func (s *Service) IssueTokens(ctx context.Context, wallet, namespace string) (string, string, int64, error)
IssueTokens generates access and refresh tokens for a verified wallet
func (*Service) JWKSHandler ¶
func (s *Service) JWKSHandler(w http.ResponseWriter, r *http.Request)
func (*Service) ParseAndVerifyJWT ¶
ParseAndVerifyJWT verifies an RS256 JWT created by this gateway and returns claims
func (*Service) RefreshToken ¶
func (s *Service) RefreshToken(ctx context.Context, refreshToken, namespace string) (string, string, int64, error)
RefreshToken validates a refresh token and issues a new access token
func (*Service) RegisterApp ¶
func (s *Service) RegisterApp(ctx context.Context, wallet, namespace, name, publicKey string) (string, error)
RegisterApp registers a new client application
func (*Service) ResolveNamespaceID ¶
ResolveNamespaceID ensures the given namespace exists and returns its primary key ID.
Click to show internal directories.
Click to hide internal directories.