Skip to content

This docker image use for testing application using generated JWT token and x509 public key endpoint, something like Google Firebase authentication.

License

Notifications You must be signed in to change notification settings

manabie-com/fake_token

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This docker image use for testing application using JWT and x509 cert endpoint, something like Google Firebase authentication.
Docker repo: https://hub.docker.com/r/nvcnvn/fake_token

Usage

docker pull nvcnvn/fake_token:1.0.0
docker run --name test_name -it -p 8080:8080 nvcnvn/fake_token:1.0.0
  • Cert endpoint: http://localhost:8080/robot/v1/metadata/x509/[email protected]
  • Token generate endpoint: http://localhost:8080/token with parameters:
    • template: template file path templates/phone.template
    • kid: specific the key (returned from cert endpoint) for signing, if not set then use a random key to sign
    • IssuerPrefix: usage in token template
    • Audience: usage in token template
    • AuthTime: if not set UnixSecond(now - 1 min)
    • UserID: if not set UnixNano(now)
    • IssueAt: if not set UnixSecond(now)
    • Expiration: if not set UnixSecond(now + 1 hour)
    • PhoneNumber: if not set "+84"+UnixSecond(now)

Config

ENV PORT=":8080"
ENV KEYS_GLOB="./private_pems/*.pem"
ENV TEMPLATES_GLOB="./templates/*.template"
ENV CERT_NOT_BEFORE="Jan 2 15:04:05 2006"
ENV CERT_NOT_AFTER="Jan 2 15:04:05 2026"

About

This docker image use for testing application using generated JWT token and x509 public key endpoint, something like Google Firebase authentication.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 92.7%
  • Dockerfile 7.3%