This is a guide to using pyjwt
to sign and validate a JWT
using
RS256.
The trickiest part of doing this is knowing what the proper OpenSSL commands are to generate the RSA keypair. I demonstrate that below.
# 1. One time setup: install GH CLI https://cli.github.com/ | |
# 2. Update $issue_to_clone and $target_repos variables | |
# 3. Manually update the project if needed (e.g. Customer Trust). Labels should be automatically cloned. | |
# Config - step 1 | |
$issue_to_clone = "https://github.com/AzureAD/microsoft-authentication-library-for-java/issues/757" | |
$repo_java = 'https://github.com/AzureAD/microsoft-authentication-library-for-java/' | |
$repo_go = 'https://github.com/AzureAD/microsoft-authentication-library-for-go/' | |
$repo_py = 'https://github.com/AzureAD/microsoft-authentication-library-for-python/' |
FROM ubuntu | |
RUN apt-get update && \ | |
apt-get install -y curl apt-utils \ | |
libasound2 libatk-bridge2.0-0 libcairo2 libcups2 libgdk-pixbuf2.0-0 \ | |
libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 \ | |
libsecret-1-0 libx11-xcb1 libxcomposite1 libxcomposite1 \ | |
libxss1 apt-transport-https libxkbfile1 | |
COPY teams.deb /tmp/teams.deb |
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c | |
[metadata] | |
name = {name} | |
version = file: {name}/_version.txt | |
author = Martin Larralde | |
author_email = martin.larralde@embl.de | |
url = https://github.com/althonos/{name} | |
description = {description} | |
long_description = file: README.md |
try: | |
import xmlrpclib | |
except ImportError: | |
import xmlrpc.client as xmlrpclib | |
client = xmlrpclib.ServerProxy('https://pypi.python.org/pypi') | |
packages = client.list_packages() | |
total = len(packages) | |
dashes = len([x for x in packages if '-' in x]) |
# ---------------- | |
# http://forum.xda-developers.com/showthread.php?t=2278508 | |
# http://forum.xda-developers.com/showthread.php?t=2294786 | |
# | |
# (require root) | |
# reset | |
wm size reset | |
wm density reset | |
wm overscan reset |
import contextlib | |
import OpenSSL.crypto | |
import os | |
import requests | |
import ssl | |
import tempfile | |
@contextlib.contextmanager | |
def pfx_to_pem(pfx_path, pfx_password): | |
''' Decrypts the .pfx file to be used with requests. ''' |
This documentation aims at being a quick-straight-to-the-point-hands-on AWS resources manipulation with [boto3][0].
First of all, you'll need to install [boto3][0]. Installing it along with [awscli][1] is probably a good idea as