github.com/avenga/couper@v1.12.2/server/testdata/integration/config/08_couper.hcl (about)

     1  server "jwt" {
     2    api {
     3      base_path = "/separate"
     4      endpoint "/{p}/create-jwt" {
     5        response {
     6          headers = {
     7            x-jwt = jwt_sign("my_jwt", {})
     8          }
     9        }
    10      }
    11      endpoint "/{p}/jwt" {
    12        access_control = [ "my_jwt" ]
    13        response {
    14          json_body = request.context.my_jwt
    15        }
    16      }
    17    }
    18    api {
    19      base_path = "/self-signed"
    20      endpoint "/{p}/create-jwt" {
    21        response {
    22          headers = {
    23            x-jwt = jwt_sign("my_jwt", {groups = []})
    24          }
    25        }
    26      }
    27      endpoint "/{p}/jwt" {
    28        access_control = [ "self_signed_jwt" ]
    29        response {
    30          json_body = request.context.self_signed_jwt
    31        }
    32      }
    33    }
    34  }
    35  definitions {
    36    jwt_signing_profile "my_jwt" {
    37      signature_algorithm = "HS256"
    38      key = "asdf"
    39      ttl = "1h"
    40      claims = {
    41        iss = "the_issuer"
    42        pid = request.path_params.p
    43        groups = ["g1", "g2"]
    44      }
    45    }
    46    jwt "my_jwt" {
    47      header = "authorization"
    48      signature_algorithm = "HS256"
    49      key = "asdf"
    50      claims = {
    51        iss = "the_issuer"
    52        pid = request.path_params.p
    53      }
    54    }
    55    jwt "self_signed_jwt" {
    56      header = "authorization"
    57      signature_algorithm = "HS256"
    58      key = "asdf"
    59      signing_ttl = "1h"
    60      claims = {
    61        iss = "the_issuer"
    62        pid = request.path_params.p
    63      }
    64    }
    65  }