Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FirebaseAuthVerifier ¶
type FirebaseAuthVerifier interface { /* Set custom logger. */ Logger(logger *Logger) FirebaseAuthVerifier /* Support Original JWT Token. sub = your GCP Project default = deny. */ AcceptOriginalToken() FirebaseAuthVerifier /* Verify Firebase Auth token. supported) - JWT: Firebase Custom Token source - JWT: Firebase Auth Token see) https://firebase.google.com/docs/auth/android/custom-auth?hl=en */ Verify(token string) (*VerifiedFirebaseAuthToken, error) }
Verifier for Firebase Auth token.
type FirebaseUser ¶
type FirebaseUser struct { /* Firebase user id. */ Id string }
func (*FirebaseUser) String ¶
func (it *FirebaseUser) String() string
type GoogleApiKeyVerifier ¶
type GoogleApiKeyVerifier interface { /* Set custom logger. */ Logger(logger *Logger) GoogleApiKeyVerifier /* Set custom service name for 'Service Control' check API. Default is 'your-gcp-name.appspot.com' https://cloud.google.com/service-infrastructure/docs/service-control/getting-started?hl=en */ ServiceName(serviceName string) GoogleApiKeyVerifier /* Verify your API Key. */ Verify(apiKey string) error }
Google Cloud Platform API Key verify.
type SecurityContext ¶
type SecurityContext interface { /* Returns Firebase auth based JWT verifier. see) - https://firebase.google.com/docs/auth?hl=en - https://github.com/firebase/firebase-admin-go/tree/master/auth */ NewFirebaseAuthVerifier() FirebaseAuthVerifier /* Returns Google API Key verifier. see) - https://cloud.google.com/docs/authentication/api-keys?hl=en */ NewGoogleApiKeyVerifier() GoogleApiKeyVerifier }
func NewSecurityContext ¶
func NewSecurityContext(configs *SecurityContextConfigs) (SecurityContext, error)
New instance.
type SecurityContextConfigs ¶
type SecurityContextConfigs struct { /* Custom context. */ Context context.Context /* Custom logger. */ Logger *Logger /* Custom GCP service account's json file. If this value is nil, then load from 'GOOGLE_APPLICATION_CREDENTIALS'. see) https://cloud.google.com/docs/authentication/getting-started?hl=en */ GoogleServiceAccountJson []byte }
logger function
type VerifiedFirebaseAuthToken ¶
type VerifiedFirebaseAuthToken struct { /* Authorize user. */ User *FirebaseUser /* Token expire time. */ ExpireAt time.Time /* JWT Claims. */ Claims map[string]interface{} }
Verified JWT Data.
func (*VerifiedFirebaseAuthToken) GetFloatClaim ¶
func (it *VerifiedFirebaseAuthToken) GetFloatClaim(key string) (float64, error)
func (*VerifiedFirebaseAuthToken) GetIntClaim ¶
func (it *VerifiedFirebaseAuthToken) GetIntClaim(key string) (int64, error)
func (*VerifiedFirebaseAuthToken) GetStringClaim ¶
func (it *VerifiedFirebaseAuthToken) GetStringClaim(key string) (string, error)
Source Files
¶
- firebase_auth_verifier.go
- firebase_auth_verifier_impl.go
- firebase_user.go
- google_api_key_verifier.go
- google_api_key_verifier_impl.go
- google_public_key.go
- google_public_key_cache.go
- internal_utils.go
- logger.go
- security_context.go
- security_context_configs.go
- security_context_impl.go
- valid_google_api_key.go
- verified_firebase_auth_token.go
Click to show internal directories.
Click to hide internal directories.