MCPcopy Create free account

hub / github.com/golang-jwt/jwt / functions

Functions181 in github.com/golang-jwt/jwt

↓ 12 callersMethodVerify
(signingString, signature string, key interface{})
signing_method.go:12
↓ 11 callersMethodSign
Returns nil if signature is valid
signing_method.go:13
↓ 10 callersMethodAlg
Returns encoded signature or error
signing_method.go:14
↓ 8 callersMethodSignedString
SignedString creates and returns a complete, signed JWT. The token is signed using the SigningMethod specified in the token.
token.go:64
↓ 7 callersMethodError
Error is the implementation of the err interface.
errors.go:58
↓ 7 callersMethodExtractToken
(*http.Request)
request/extractor.go:18
↓ 7 callersMethodParseWithClaims
ParseWithClaims parses, validates, and verifies like Parse, but supplies a default object implementing the Claims interface. This provides default val
parser.go:52
↓ 7 callersFunctionbenchmarkSigning
Helper method for benchmarking various signing methods
parser_test.go:722
↓ 6 callersFunctionDecodeSegment
DecodeSegment decodes a JWT specific base64url encoding with padding stripped Deprecated: In a future release, we will demote this function to a non-
token.go:129
↓ 6 callersFunctionEncodeSegment
EncodeSegment encodes a JWT specific base64url encoding with padding stripped Deprecated: In a future release, we will demote this function to a non-
token.go:121
↓ 6 callersMethodParse
Parse parses, validates, verifies the signature and returns the parsed token. keyFunc will receive the parsed token and should return the key for vali
parser.go:41
↓ 6 callersFunctionRegisterSigningMethod
RegisterSigningMethod registers the "alg" name and a factory function for signing method. This is typically done during init() in the method's impleme
signing_method.go:19
↓ 4 callersFunctionNewValidationError
NewValidationError is a helper for constructing a ValidationError with a string error message
errors.go:43
↓ 4 callersMethodSet
(arg string)
cmd/jwt/main.go:337
↓ 4 callersMethodString
()
cmd/jwt/main.go:332
↓ 4 callersFunctionmakeExampleRequest
(method, path string, headers map[string]string, urlArgs url.Values)
request/extractor_test.go:85
↓ 4 callersFunctionnewNumericDateFromSeconds
newNumericDateFromSeconds creates a new *NumericDate out of a float64 representing a UNIX epoch with the float fraction representing non-integer secon
types.go:44
↓ 4 callersFunctionsignToken
signToken creates and returns a signed JWT token using signingMethod.
parser_test.go:327
↓ 4 callersMethodvalid
No errors
errors.go:74
↓ 3 callersMethodIs
Is checks if this ValidationError is of the supplied error. We are first checking for the exact error message by comparing the inner error message. If
errors.go:81
↓ 3 callersFunctionLoadRSAPrivateKeyFromDisk
(location string)
test/helpers.go:11
↓ 3 callersFunctionLoadRSAPublicKeyFromDisk
(location string)
test/helpers.go:23
↓ 3 callersMethodParseUnverified
ParseUnverified parses the token but doesn't validate the signature. WARNING: Don't use this method unless you know what you're doing. It's only eve
parser.go:125
↓ 3 callersMethodSigningString
SigningString generates the signing string. This is the most expensive part of the whole deal. Unless you need this for something special, just go s
token.go:80
↓ 3 callersMethodVerifyExpiresAt
VerifyExpiresAt compares the exp claim against cmp (cmp <= exp). If req is false, it will return true, if exp is unset.
map_claims.go:37
↓ 3 callersFunctionfatal
(err error)
http_example_test.go:63
↓ 3 callersFunctionloadData
Helper func: Read input from specified file or stdin
cmd/jwt/main.go:76
↓ 3 callersFunctionverifyAud
----- helpers
claims.go:220
↓ 3 callersFunctionverifyExp
(exp *time.Time, now time.Time, required bool)
claims.go:243
↓ 3 callersFunctionverifyIat
(iat *time.Time, now time.Time, required bool)
claims.go:250
↓ 3 callersFunctionverifyIss
(iss string, cmp string, required bool)
claims.go:264
↓ 3 callersFunctionverifyNbf
(nbf *time.Time, now time.Time, required bool)
claims.go:257
↓ 2 callersFunctionMakeSampleToken
MakeSampleToken creates and returns a encoded JWT token that has been signed with the specified cryptographic key.
test/helpers.go:36
↓ 2 callersFunctionNewParser
NewParser creates a new Parser with the specified options
parser.go:28
↓ 2 callersFunctionParseFromRequest
ParseFromRequest extracts and parses a JWT token from an HTTP request. This behaves the same as Parse, but accepts a request and an extractor instead
request/request.go:15
↓ 2 callersMethodVerifyIssuedAt
VerifyIssuedAt compares the exp claim against cmp (cmp >= iat). If req is false, it will return true, if iat is unset.
map_claims.go:63
↓ 2 callersMethodVerifyNotBefore
VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf). If req is false, it will return true, if nbf is unset.
map_claims.go:89
↓ 2 callersFunctionWithClaims
WithClaims parses with custom claims
request/request.go:59
↓ 2 callersFunctioncreateToken
(user string)
http_example_test.go:139
↓ 2 callersFunctionisEd
()
cmd/jwt/main.go:303
↓ 2 callersFunctionisEs
()
cmd/jwt/main.go:295
↓ 2 callersFunctionisNone
()
cmd/jwt/main.go:307
↓ 2 callersFunctionisRs
()
cmd/jwt/main.go:299
↓ 2 callersFunctionprintJSON
Print a json object in accordance with the prophecy (or the command line options)
cmd/jwt/main.go:98
↓ 1 callersFunctionGetSigningMethod
GetSigningMethod retrieves a signing method from an "alg" string
signing_method.go:27
↓ 1 callersFunctionLoadECPrivateKeyFromDisk
(location string)
test/helpers.go:47
↓ 1 callersFunctionLoadECPublicKeyFromDisk
(location string)
test/helpers.go:59
↓ 1 callersMethodMarshalJSON
MarshalJSON is an implementation of the json.RawMessage interface and serializes the UNIX epoch represented in NumericDate to a byte array, using the
types.go:51
↓ 1 callersFunctionNewNumericDate
NewNumericDate constructs a new *NumericDate from a standard library time.Time struct. It will truncate the timestamp according to the precision speci
types.go:38
↓ 1 callersFunctionNewWithClaims
NewWithClaims creates a new Token with the specified signing method and claims.
token.go:51
↓ 1 callersFunctionParseFromRequestWithClaims
ParseFromRequestWithClaims is an alias for ParseFromRequest but with custom Claims type. Deprecated: use ParseFromRequest and the WithClaims option
request/request.go:45
↓ 1 callersMethodUnwrap
Unwrap gives errors.Is and errors.As access to the inner error.
errors.go:69
↓ 1 callersMethodValid
()
claims.go:12
↓ 1 callersMethodVerifyAudience
VerifyAudience Compares the aud claim against cmp. If required is false, this method will return true if the value matches or is unset
map_claims.go:16
↓ 1 callersMethodVerifyExpiresAt
VerifyExpiresAt compares the exp claim against cmp (cmp < exp). If req is false, it will return true, if exp is unset.
claims.go:88
↓ 1 callersMethodVerifyExpiresAt
VerifyExpiresAt compares the exp claim against cmp (cmp < exp). If req is false, it will return true, if exp is unset.
claims.go:181
↓ 1 callersMethodVerifyIssuedAt
VerifyIssuedAt compares the iat claim against cmp (cmp >= iat). If req is false, it will return true, if iat is unset.
claims.go:98
↓ 1 callersMethodVerifyIssuedAt
VerifyIssuedAt compares the iat claim against cmp (cmp >= iat). If req is false, it will return true, if iat is unset.
claims.go:192
↓ 1 callersMethodVerifyNotBefore
VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf). If req is false, it will return true, if nbf is unset.
claims.go:108
↓ 1 callersMethodVerifyNotBefore
VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf). If req is false, it will return true, if nbf is unset.
claims.go:203
↓ 1 callersFunctionalgHelp
()
cmd/jwt/main.go:311
↓ 1 callersFunctionbenchmarkParsing
Helper method for benchmarking various parsing methods
parser_test.go:707
↓ 1 callersFunctionmakeToken
(method jwt.SigningMethod)
rsa_pss_test.go:134
↓ 1 callersFunctionshowToken
showToken pretty-prints the token on the command line.
cmd/jwt/main.go:263
↓ 1 callersFunctionsignToken
Create, sign, and output a token. This is a great, simple example of how to use this library to create and sign a token.
cmd/jwt/main.go:175
↓ 1 callersFunctionstart
Figure out which thing to do and then do that
cmd/jwt/main.go:62
↓ 1 callersFunctionverify
(signingMethod jwt.SigningMethod, token string)
rsa_pss_test.go:147
↓ 1 callersFunctionverifyToken
Verify a token and output the claims. This is a great example of how to verify and view a token.
cmd/jwt/main.go:117
MethodAlg
()
rsa.go:43
MethodAlg
()
ecdsa.go:52
MethodAlg
()
ed25519.go:31
MethodAlg
()
hmac.go:44
MethodAlg
()
none.go:23
FunctionBenchmarkECDSAParsing
(b *testing.B)
ecdsa_test.go:109
FunctionBenchmarkECDSASigning
(b *testing.B)
ecdsa_test.go:127
FunctionBenchmarkHS256Signing
(b *testing.B)
hmac_test.go:82
FunctionBenchmarkHS384Signing
(b *testing.B)
hmac_test.go:86
FunctionBenchmarkHS512Signing
(b *testing.B)
hmac_test.go:90
FunctionBenchmarkParseUnverified
(b *testing.B)
parser_test.go:678
FunctionBenchmarkRS256Signing
(b *testing.B)
rsa_test.go:167
FunctionBenchmarkRS384Signing
(b *testing.B)
rsa_test.go:177
FunctionBenchmarkRS512Signing
(b *testing.B)
rsa_test.go:187
FunctionBenchmarkRSAParsing
(b *testing.B)
rsa_test.go:153
FunctionBenchmarkToken_SigningString
(b *testing.B)
token_test.go:63
FunctionExampleArgumentExtractor
()
request/extractor_example_test.go:23
FunctionExampleHeaderExtractor
()
request/extractor_example_test.go:12
FunctionExampleNewWithClaims_customClaimsType
Example creating a token using a custom claims type. The RegisteredClaims is embedded in the custom type to allow for easy encoding, parsing and valid
example_test.go:33
FunctionExampleNewWithClaims_registeredClaims
Example (atypical) using the RegisteredClaims type by itself to parse a token. The RegisteredClaims type is designed to be embedded into your custom t
example_test.go:16
FunctionExampleNew_hmac
Example creating, signing, and encoding a JWT token using the HMAC signing method
hmac_example_test.go:26
FunctionExampleParseWithClaims_customClaimsType
Example creating a token using a custom claims type. The StandardClaim is embedded in the custom type to allow for easy encoding, parsing and validat
example_test.go:75
FunctionExampleParse_errorChecking
An example of parsing the error types using bitfield checks
example_test.go:97
FunctionExampleParse_hmac
Example parsing and validating a token using the HMAC signing method
hmac_example_test.go:42
FunctionExample_getTokenViaHTTP
()
http_example_test.go:81
FunctionExample_useTokenViaHTTP
()
http_example_test.go:115
MethodExtractToken
(req *http.Request)
request/extractor.go:25
MethodExtractToken
(req *http.Request)
request/extractor.go:40
MethodExtractToken
(req *http.Request)
request/extractor.go:57
MethodExtractToken
(req *http.Request)
request/extractor.go:76
MethodExtractToken
(req *http.Request)
request/extractor.go:89
FunctionGetAlgorithms
GetAlgorithms returns a list of registered "alg" names
signing_method.go:38
next →1–100 of 181, ranked by callers