...

Source file src/gopkg.in/square/go-jose.v2/jwt/errors.go

Documentation: gopkg.in/square/go-jose.v2/jwt

     1  /*-
     2   * Copyright 2016 Zbigniew Mandziejewicz
     3   * Copyright 2016 Square, Inc.
     4   *
     5   * Licensed under the Apache License, Version 2.0 (the "License");
     6   * you may not use this file except in compliance with the License.
     7   * You may obtain a copy of the License at
     8   *
     9   *     http://www.apache.org/licenses/LICENSE-2.0
    10   *
    11   * Unless required by applicable law or agreed to in writing, software
    12   * distributed under the License is distributed on an "AS IS" BASIS,
    13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14   * See the License for the specific language governing permissions and
    15   * limitations under the License.
    16   */
    17  
    18  package jwt
    19  
    20  import "errors"
    21  
    22  // ErrUnmarshalAudience indicates that aud claim could not be unmarshalled.
    23  var ErrUnmarshalAudience = errors.New("square/go-jose/jwt: expected string or array value to unmarshal to Audience")
    24  
    25  // ErrUnmarshalNumericDate indicates that JWT NumericDate could not be unmarshalled.
    26  var ErrUnmarshalNumericDate = errors.New("square/go-jose/jwt: expected number value to unmarshal NumericDate")
    27  
    28  // ErrInvalidClaims indicates that given claims have invalid type.
    29  var ErrInvalidClaims = errors.New("square/go-jose/jwt: expected claims to be value convertible into JSON object")
    30  
    31  // ErrInvalidIssuer indicates invalid iss claim.
    32  var ErrInvalidIssuer = errors.New("square/go-jose/jwt: validation failed, invalid issuer claim (iss)")
    33  
    34  // ErrInvalidSubject indicates invalid sub claim.
    35  var ErrInvalidSubject = errors.New("square/go-jose/jwt: validation failed, invalid subject claim (sub)")
    36  
    37  // ErrInvalidAudience indicated invalid aud claim.
    38  var ErrInvalidAudience = errors.New("square/go-jose/jwt: validation failed, invalid audience claim (aud)")
    39  
    40  // ErrInvalidID indicates invalid jti claim.
    41  var ErrInvalidID = errors.New("square/go-jose/jwt: validation failed, invalid ID claim (jti)")
    42  
    43  // ErrNotValidYet indicates that token is used before time indicated in nbf claim.
    44  var ErrNotValidYet = errors.New("square/go-jose/jwt: validation failed, token not valid yet (nbf)")
    45  
    46  // ErrExpired indicates that token is used after expiry time indicated in exp claim.
    47  var ErrExpired = errors.New("square/go-jose/jwt: validation failed, token is expired (exp)")
    48  
    49  // ErrIssuedInTheFuture indicates that the iat field is in the future.
    50  var ErrIssuedInTheFuture = errors.New("square/go-jose/jwt: validation field, token issued in the future (iat)")
    51  
    52  // ErrInvalidContentType indicates that token requires JWT cty header.
    53  var ErrInvalidContentType = errors.New("square/go-jose/jwt: expected content type to be JWT (cty header)")
    54  

View as plain text