direct-actions/JSON Web Token (JWT)
Encode/Decode/Sign/Verify JSON Web Tokens with options including masking, JSON object dump & more.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stalelast commit Nov 19, 2024
- License
- Apache 2.0
Pinned Snippet
uses: direct-actions/jwt@78816fbc34fe31cf1445a1cdff4e39c2b9e79f57 # v1.1.1tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| algorithm | (Encode) Signing algorithm for encoding a new JWT, only HS256 currently supported. | — | HS256 |
| debug | (Decode/Encode) Enable debugging output. | — | false |
| enable-display | (Decode/Encode) Enable pretty colorized display of JWT decoded object. | — | false |
| enable-fail-on-unverified | (Decode) Fail if the JWT signing cannot be verified. | — | true |
| enable-mask-jwt | (Decode/Encode) Enable masking of entire JWT in Actions output. | — | false |
| enable-mask-signature | (Decode/Encode) Enable masking of JWT signature in Actions output. | — | true |
| header | (Encode) Header yq template for encoding a new JWT (JSON or YAML). | — | alg: ${ALGORITHM} typ: JWT |
| jwt | (Decode) JWT that will be decoded & verified. | no | — |
| payload | (Encode) Payload data structure for encoding a new JWT (JSON or YAML). | no | — |
| secret | (Decode/Encode) Secret used to sign or verify a signed JWT. | — | your-256-bit-secret |
Outputs
| name | description |
|---|---|
| algorithm | Signing algorithm. |
| header | Decoded header in JSON. |
| jwt | Encoded & signed JWT. |
| payload | Decoded payload in JSON. |
| signature | Decoded signature in Base64 (not URL safe Base64). |
| verified | Boolean-as-string ("true" / "false") indicating if the JWT is verified. |