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
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
~ Copyright 2019 Red Hat, Inc. and/or its affiliates | |
~ and other contributors as indicated by the @author tags. | |
~ | |
~ Licensed under the Apache License, Version 2.0 (the "License"); | |
~ you may not use this file except in compliance with the License. | |
~ You may obtain a copy of the License at | |
~ | |
~ http://www.apache.org/licenses/LICENSE-2.0 |
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
VAULT_NAME = {{ vault_name }} | |
SECRET_NAME = {{ secret_name }} | |
FILENAME = {{ filename }} | |
az keyvault secret set --vault-name $VAULT_NAME --name $SECRET_NAME --file $FILENAME |
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
# Healthcheck for strict HTTPS | |
healthcheck: | |
test: ["CMD", "curl", "-f", "http://localhost:8443/health"] | |
interval: 10s | |
timeout: 5s | |
retries: 5 | |
# Healthcheck for HTTP enabled | |
healthcheck: | |
test: ["CMD", "curl", "-f", "http://localhost:8080/health"] |
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
healthcheck: | |
test: ["CMD-SHELL", "pg_isready -U postgres"] | |
interval: 10s | |
timeout: 5s | |
retries: 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
SERVICE_PRINCIPAL = {{ service_principal_name }} | |
az ad sp create-for-rbac --name $SERVICE_PRINCIPAL --sdk-auth |
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
swagger: 2.0 | |
securityDefinitions: | |
Bearer: | |
type: apiKey | |
in: header | |
name: Authorization | |
paths: | |
/auth: | |
post: | |
summary: Get a bearer token |
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
# /app/__init__.py | |
import json | |
from flask import ( | |
Flask | |
) | |
from flask_oidc import ( | |
OpenIDConnect | |
) |
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
import unittest | |
# User defined funtion to compare method names when sorting them in order | |
# to be executed in the unit test. | |
def unit_test_order(): | |
order = {} | |
def ordered(f): | |
order[f.__name__] = len(order) | |
return f |
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
export USERNAME={{ username }} | |
export PASSWORD={{ password }} | |
export CLIENT_ID={{ client_id }} | |
export CLIENT_SECRET={{ client_secret }} | |
export HOSTNAME={{ hostname }} | |
export REALM={{ realm }} | |
export AUTH_TOKEN=`curl -s -d "client_id=$CLIENT_ID" -d "client_secret=$CLIENT_SECRET" \ | |
-d "username=$USERNAME" -d "password=$PASSWORD" -d "grant_type=$PASSWORD" \ | |
"https://$HOSTNAME:8443/auth/realms/$REALM/protocol/openid-connect/token" | jq -r '.access_token'` |
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 timezonefinder import TimezoneFinderL | |
def timezone_finder_l(): | |
return TimeZoneFinderL(in_memory=True) | |
# Initialize class and load binary files into memory. | |
get_timezone = timezone_finder_l() | |
# Return timezone for coordinates based on precomputed shortcuts. | |
get_timezone.timezone_at( |