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 )"
if [[ -z "${KEYCLOAK_BASE_URL:-}" ]]; then
export KEYCLOAK_BASE_URL=https://keycloak.dev.spiffworkflow.org
export KEYCLOAK_BASE_URL="http://localhost:7002"
fi
if [[ -z "${BACKEND_BASE_URL:-}" ]]; then
export BACKEND_BASE_URL=https://api.dev.spiffworkflow.org
export BACKEND_BASE_URL=http://localhost:7000
fi
process_model_identifier="${1:-}"

View File

@ -24,6 +24,7 @@ class FileType(SpiffEnum):
ppt = "ppt"
pptx = "pptx"
rtf = "rtf"
sql = "sql"
svg = "svg"
svg_xml = "svg+xml"
txt = "txt"
@ -48,6 +49,7 @@ CONTENT_TYPES = {
"ppt": "application/vnd.ms-powerpoint",
"pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
"rtf": "application/rtf",
"sql": "text/plain",
"svg": "image/svg+xml",
"svg_xml": "image/svg+xml",
"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
# 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_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"]
if not token and "X-API-KEY" in request.headers:
api_key = request.headers["X-API-KEY"]
if not token and "SpiffWorkflow-Api-key" in request.headers:
api_key = request.headers["SpiffWorkflow-Api-key"]
token_info = {"token": token, "api_key": api_key}
return token_info

View File

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

View File

@ -40,7 +40,7 @@ class TestServiceAccounts(BaseTest):
response = client.post(
"/v1.0/secrets",
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),
)
assert response.status_code == 201

View File

@ -328,48 +328,53 @@ export default function ProcessModelShow() {
return null;
}
let constructedTag;
const tags = processModel.files.map((processModelFile: ProcessFile) => {
const isPrimaryBpmnFile =
processModelFile.name === processModel.primary_file_name;
const tags = processModel.files
.map((processModelFile: ProcessFile) => {
if (!processModelFile.name.match(/\.(dmn|bpmn|json|md)$/)) {
return undefined;
}
const isPrimaryBpmnFile =
processModelFile.name === processModel.primary_file_name;
let actionsTableCell = null;
if (processModelFile.name.match(/\.(dmn|bpmn|json|md)$/)) {
actionsTableCell = (
<TableCell key={`${processModelFile.name}-cell`} align="right">
{renderButtonElements(processModelFile, isPrimaryBpmnFile)}
</TableCell>
);
}
let actionsTableCell = null;
if (processModelFile.name.match(/\.(dmn|bpmn|json|md)$/)) {
actionsTableCell = (
<TableCell key={`${processModelFile.name}-cell`} align="right">
{renderButtonElements(processModelFile, isPrimaryBpmnFile)}
</TableCell>
);
}
let primarySuffix = null;
if (isPrimaryBpmnFile) {
primarySuffix = (
<span>
&nbsp;-{' '}
<span className="primary-file-text-suffix">Primary File</span>
</span>
let primarySuffix = null;
if (isPrimaryBpmnFile) {
primarySuffix = (
<span>
&nbsp;-{' '}
<span className="primary-file-text-suffix">Primary File</span>
</span>
);
}
let fileLink = null;
const fileUrl = profileModelFileEditUrl(processModelFile);
if (fileUrl) {
fileLink = <Link to={fileUrl}>{processModelFile.name}</Link>;
}
constructedTag = (
<TableRow key={processModelFile.name}>
<TableCell
key={`${processModelFile.name}-cell`}
className="process-model-file-table-filename"
title={processModelFile.name}
>
{fileLink}
{primarySuffix}
</TableCell>
{actionsTableCell}
</TableRow>
);
}
let fileLink = null;
const fileUrl = profileModelFileEditUrl(processModelFile);
if (fileUrl) {
fileLink = <Link to={fileUrl}>{processModelFile.name}</Link>;
}
constructedTag = (
<TableRow key={processModelFile.name}>
<TableCell
key={`${processModelFile.name}-cell`}
className="process-model-file-table-filename"
title={processModelFile.name}
>
{fileLink}
{primarySuffix}
</TableCell>
{actionsTableCell}
</TableRow>
);
return constructedTag;
});
return constructedTag;
})
.filter((element: any) => element !== undefined);
if (tags.length > 0) {
return (