This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ignition": { | |
"config": { | |
"replace": { | |
"source": null, | |
"verification": {} | |
} | |
}, | |
"security": { | |
"tls": {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scrollback_lines 10000 | |
#Fonts | |
font_family Cascadia Code Regular | |
bold_font auto | |
italic_font auto | |
bold_italic_font auto | |
font_size 12.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## History wrapper | |
function omz_history { | |
local clear list | |
zparseopts -E c=clear l=list | |
if [[ -n "$clear" ]]; then | |
# if -c provided, clobber the history file | |
echo -n >| "$HISTFILE" | |
echo >&2 History file deleted. Reload the session to see its effects. | |
elif [[ -n "$list" ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Keybindings section | |
bindkey -e | |
bindkey '^[[7~' beginning-of-line # Home key | |
bindkey '^[[H' beginning-of-line # Home key | |
if [[ "${terminfo[khome]}" != "" ]]; then | |
bindkey "${terminfo[khome]}" beginning-of-line # [Home] - Go to beginning of line | |
fi | |
bindkey '^[[8~' end-of-line # End key | |
bindkey '^[[F' end-of-line # End key | |
if [[ "${terminfo[kend]}" != "" ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jwt_payload = jwt.decode(jwt_id_token, public_key, algorithms=[jwt_alg], audience=audience) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jwt.algorithms import RSAAlgorithm | |
jwt_key = [key for key in JWKS_KEYS if key['kid'] == jwt_kid][0] | |
public_key = RSAAlgorithm.from_jwk(json.dumps(jwt_key)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jwt_headers = jwt.get_unverified_header(jwt_id_token) | |
jwt_alg = jwt_headers['alg'] | |
jwt_kid = jwt_headers['kid'] # kid is short for key id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if jwks_uri is not None: | |
response = requests.get(jwks_uri) | |
response_json = response.json() | |
keys = response_json.get("keys", None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GOOGLE_DISCOVERY_URI = "https://accounts.google.com/.well-known/openid-configuration" | |
response = requests.get(GOOGLE_DISCOVERY_URI) | |
response_json = response.json() | |
# If for any reason we don't get the expected response | |
# using the get method is safer | |
jwks_uri = response_json.get("jwks_uri", None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flow = google_auth_oauthlib.flow.Flow.from_client_config( | |
CLIENT_SECRET, scopes=SCOPES) | |
flow.redirect_uri = url_for('oauth2_callback', _external=True) | |
authorization_response = request.url | |
# Replace with https to avoid InsecureTrasnportError | |
authorization_response = authorization_response.replace('http', 'https') | |
flow.fetch_token(authorization_response=authorization_response) |