aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/golang-jwt/jwt/v5/registered_claims.go
diff options
context:
space:
mode:
authorLibravatar Rutger Broekhoff2023-12-30 14:00:34 +0100
committerLibravatar Rutger Broekhoff2023-12-30 14:00:34 +0100
commitf6c92c5e2d87ab1334648b0d1293771de7aae4a5 (patch)
tree265c3a06accd398a1e0a173af56d7392a5f94a24 /vendor/github.com/golang-jwt/jwt/v5/registered_claims.go
parent4f167c0fa991aa9ddb3f0252e23694b3aa6532b1 (diff)
downloadgitolfs3-f6c92c5e2d87ab1334648b0d1293771de7aae4a5.tar.gz
gitolfs3-f6c92c5e2d87ab1334648b0d1293771de7aae4a5.zip
Implement git-lfs-authenticate
Diffstat (limited to 'vendor/github.com/golang-jwt/jwt/v5/registered_claims.go')
-rw-r--r--vendor/github.com/golang-jwt/jwt/v5/registered_claims.go63
1 files changed, 63 insertions, 0 deletions
diff --git a/vendor/github.com/golang-jwt/jwt/v5/registered_claims.go b/vendor/github.com/golang-jwt/jwt/v5/registered_claims.go
new file mode 100644
index 0000000..77951a5
--- /dev/null
+++ b/vendor/github.com/golang-jwt/jwt/v5/registered_claims.go
@@ -0,0 +1,63 @@
1package jwt
2
3// RegisteredClaims are a structured version of the JWT Claims Set,
4// restricted to Registered Claim Names, as referenced at
5// https://datatracker.ietf.org/doc/html/rfc7519#section-4.1
6//
7// This type can be used on its own, but then additional private and
8// public claims embedded in the JWT will not be parsed. The typical use-case
9// therefore is to embedded this in a user-defined claim type.
10//
11// See examples for how to use this with your own claim types.
12type RegisteredClaims struct {
13 // the `iss` (Issuer) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.1
14 Issuer string `json:"iss,omitempty"`
15
16 // the `sub` (Subject) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.2
17 Subject string `json:"sub,omitempty"`
18
19 // the `aud` (Audience) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.3
20 Audience ClaimStrings `json:"aud,omitempty"`
21
22 // the `exp` (Expiration Time) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4
23 ExpiresAt *NumericDate `json:"exp,omitempty"`
24
25 // the `nbf` (Not Before) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.5
26 NotBefore *NumericDate `json:"nbf,omitempty"`
27
28 // the `iat` (Issued At) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.6
29 IssuedAt *NumericDate `json:"iat,omitempty"`
30
31 // the `jti` (JWT ID) claim. See https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.7
32 ID string `json:"jti,omitempty"`
33}
34
35// GetExpirationTime implements the Claims interface.
36func (c RegisteredClaims) GetExpirationTime() (*NumericDate, error) {
37 return c.ExpiresAt, nil
38}
39
40// GetNotBefore implements the Claims interface.
41func (c RegisteredClaims) GetNotBefore() (*NumericDate, error) {
42 return c.NotBefore, nil
43}
44
45// GetIssuedAt implements the Claims interface.
46func (c RegisteredClaims) GetIssuedAt() (*NumericDate, error) {
47 return c.IssuedAt, nil
48}
49
50// GetAudience implements the Claims interface.
51func (c RegisteredClaims) GetAudience() (ClaimStrings, error) {
52 return c.Audience, nil
53}
54
55// GetIssuer implements the Claims interface.
56func (c RegisteredClaims) GetIssuer() (string, error) {
57 return c.Issuer, nil
58}
59
60// GetSubject implements the Claims interface.
61func (c RegisteredClaims) GetSubject() (string, error) {
62 return c.Subject, nil
63}