GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - BinarSkugga/gcp-jwt: Simple library to create and sign JWT tokens using the Google Cloud Platform KMS.

BranchesTags
Open more actions menu

Latest commit

 

History

15 Commits
15 Commits

Folders and files

NameName
Last commit message
Last commit date
gcpjwt
gcpjwt
 
 
resources
resources
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
clean.py
clean.py
 
 
publish.bat
publish.bat
 
 
setup.py
setup.py
 
 

Repository files navigation

GCP-JWT

GCP-JWT is a library to create and sign tokens using the Google Cloud Platform's Key Management Service. It handles the signing and verification of the token.

Key Features

  • Token Signage
  • Signature Verification
  • Expiry Verification

  • Auto Rotating Asymmetric Key
  • Batch Token Generation
  • Compression Option
  • Symmetrically Encrypted Layer
  • Pretty API

GCP Roles Needed

To be able to use this library you'll need a GCP service account with at least the following roles:

  • cloudkms.cryptoKeyVersions.list
  • cloudkms.cryptoKeyVersions.useToSign
  • cloudkms.cryptoKeyVersions.viewPublicKey

Why not using GCP integrated auth ?

Some projects require more flexibility, I've also personally came across a case where a company didn't want Google to manage the authentication process. Whether or not this should be used in production is outside the scope of this project.

Simple Usage

from google.cloud import kms

from gcpjwt.jwt import JWT
from gcpjwt.jwt_signer import JWTSigner

# Create a client using a json file and initialise an asymmetric signer.
client = kms.KeyManagementServiceClient.from_service_account_file('../resources/google.json')
signer = JWTSigner(client, 'your-project', 'your-ring-location')

# Create a simple JWT without changing any claims.
jwt = JWT(signer, 'your-ring', 'your-key')
text_token = jwt.token()

Install

pip install gcp-jwt

Note: This project uses the cryptography package which needs to install natives. It might not be compatible with App Engine Standard because of the limited libraries allowed.

About

Simple library to create and sign JWT tokens using the Google Cloud Platform KMS.

Topics

gcpgoogle-cloud-platformjwtjwt-authenticationsign-tokens

Resources

Readme
MIT license
Activity

Stars

4 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.