added some updates to help with logging deployments w/ burnettk (#683)

Co-authored-by: jasquat <jasquat@users.noreply.github.com>
Co-authored-by: burnettk <burnettk@users.noreply.github.com>
This commit is contained in:
Kevin Burnett 2023-11-16 13:15:49 -08:00 committed by GitHub
parent 9f58c7405d
commit 8d85e5ac26
7 changed files with 55 additions and 46 deletions

View File

@ -10,10 +10,10 @@ set -o errtrace -o errexit -o nounset -o pipefail
script_dir="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" script_dir="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
if [[ -z "${KEYCLOAK_BASE_URL:-}" ]]; then if [[ -z "${KEYCLOAK_BASE_URL:-}" ]]; then
export KEYCLOAK_BASE_URL=https://keycloak.dev.spiffworkflow.org export KEYCLOAK_BASE_URL="http://localhost:7002"
fi fi
if [[ -z "${BACKEND_BASE_URL:-}" ]]; then if [[ -z "${BACKEND_BASE_URL:-}" ]]; then
export BACKEND_BASE_URL=https://api.dev.spiffworkflow.org export BACKEND_BASE_URL=http://localhost:7000
fi fi
process_model_identifier="${1:-}" process_model_identifier="${1:-}"

View File

@ -24,6 +24,7 @@ class FileType(SpiffEnum):
ppt = "ppt" ppt = "ppt"
pptx = "pptx" pptx = "pptx"
rtf = "rtf" rtf = "rtf"
sql = "sql"
svg = "svg" svg = "svg"
svg_xml = "svg+xml" svg_xml = "svg+xml"
txt = "txt" txt = "txt"
@ -48,6 +49,7 @@ CONTENT_TYPES = {
"ppt": "application/vnd.ms-powerpoint", "ppt": "application/vnd.ms-powerpoint",
"pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation", "pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
"rtf": "application/rtf", "rtf": "application/rtf",
"sql": "text/plain",
"svg": "image/svg+xml", "svg": "image/svg+xml",
"svg_xml": "image/svg+xml", "svg_xml": "image/svg+xml",
"txt": "text/plain", "txt": "text/plain",

View File

@ -13,7 +13,7 @@ from spiffworkflow_backend.models.db import db
# this is designed to be used for the "service" column on the user table, which is designed to hold # this is designed to be used for the "service" column on the user table, which is designed to hold
# information about which authentiation system is used to authenticate this user. # information about which authentiation system is used to authenticate this user.
# in this case, we are authenticating based on X-API-KEY which correlates to a known value in the spiff db. # in this case, we are authenticating based on SpiffWorkflow-Api-key which correlates to a known value in the spiff db.
SPIFF_SERVICE_ACCOUNT_AUTH_SERVICE = "spiff_service_account" SPIFF_SERVICE_ACCOUNT_AUTH_SERVICE = "spiff_service_account"
SPIFF_SERVICE_ACCOUNT_AUTH_SERVICE_ID_PREFIX = "service_account_" SPIFF_SERVICE_ACCOUNT_AUTH_SERVICE_ID_PREFIX = "service_account_"

View File

@ -313,8 +313,8 @@ def _find_token_from_headers(token: str | None) -> dict[str, str | None]:
): ):
token = request.cookies["access_token"] token = request.cookies["access_token"]
if not token and "X-API-KEY" in request.headers: if not token and "SpiffWorkflow-Api-key" in request.headers:
api_key = request.headers["X-API-KEY"] api_key = request.headers["SpiffWorkflow-Api-key"]
token_info = {"token": token, "api_key": api_key} token_info = {"token": token, "api_key": api_key}
return token_info return token_info

View File

@ -18,6 +18,8 @@ class GetTaskDataValue(Script):
def run(self, script_attributes_context: ScriptAttributesContext, *args: Any, **kwargs: Any) -> Any: def run(self, script_attributes_context: ScriptAttributesContext, *args: Any, **kwargs: Any) -> Any:
variable_to_check = args[0] variable_to_check = args[0]
default_value = None
if len(args) > 1:
default_value = args[1] default_value = args[1]
task = script_attributes_context.task task = script_attributes_context.task

View File

@ -40,7 +40,7 @@ class TestServiceAccounts(BaseTest):
response = client.post( response = client.post(
"/v1.0/secrets", "/v1.0/secrets",
content_type="application/json", content_type="application/json",
headers={"X-API-KEY": service_account.api_key}, headers={"SpiffWorkflow-Api-Key": service_account.api_key},
data=json.dumps(post_body), data=json.dumps(post_body),
) )
assert response.status_code == 201 assert response.status_code == 201

View File

@ -328,7 +328,11 @@ export default function ProcessModelShow() {
return null; return null;
} }
let constructedTag; let constructedTag;
const tags = processModel.files.map((processModelFile: ProcessFile) => { const tags = processModel.files
.map((processModelFile: ProcessFile) => {
if (!processModelFile.name.match(/\.(dmn|bpmn|json|md)$/)) {
return undefined;
}
const isPrimaryBpmnFile = const isPrimaryBpmnFile =
processModelFile.name === processModel.primary_file_name; processModelFile.name === processModel.primary_file_name;
@ -369,7 +373,8 @@ export default function ProcessModelShow() {
</TableRow> </TableRow>
); );
return constructedTag; return constructedTag;
}); })
.filter((element: any) => element !== undefined);
if (tags.length > 0) { if (tags.length > 0) {
return ( return (