Categorygithub.com/bamnet/gmp-jwt
module
0.0.0-20240929200817-859a66c5c6c2
Repository: https://github.com/bamnet/gmp-jwt.git
Documentation: pkg.go.dev

# README

gmp-jwt (experimental)

GMP-JWT generates JWTs suitable for use authenticating to Google Maps Platform APIs.

Supports:

The server (server/main.go) can be customized with the following flags:

FlagENV
--allowed_apisALLOWED_APISComma-seperated list of APIs tokens can be generated for, or * for all supported. Defaults to * (all APIs).
--cors_originsCORS_ORIGINSValue to set for the 'Access-Control-Allow-Origin' header. Use * for wildcard, which is dangerous in production.
--enable_appcheckENABLE_APPCHECKIf set, requests must a valid token from app check in the X-Firebase-AppCheck header.
--token_durationTOKEN_DURATIONDuration a generated token is valid for (default 30m0s).

Run on Google Cloud


Tokens are generated using an available Service Account via Application Default Credentials. Practically, this means the either provided automatically when run on Cloud Run, GCE, etc or manually provided via the GOOGLE_APPLICATION_CREDENTIALS ENV variable.

An apis parameter can be set to pass a list of APIs that the token should include. This list must be a subset of the allowed_apis.

As an example, if the server was started with ALLOWED_APIs=* you could request different tokens using /?apis=routes which will return a token scoped to the Routes API. /?apis=addressvalidation,routes will return a token scoped to both Address Validation and Routes API.

# Packages

Package apis contains JWT claim values for Google Maps Platform APIs.
No description provided by the author
No description provided by the author