Skip to content

Commit

Permalink
ci: fix linter warnings (#1109)
Browse files Browse the repository at this point in the history
Signed-off-by: Pat Losoponkul <pat.losoponkul@iohk.io>
  • Loading branch information
patlo-iog committed May 28, 2024
1 parent 4eda59a commit 0eff8cb
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 57 deletions.
8 changes: 5 additions & 3 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ DISABLE_LINTERS:
- CPP_CPPLINT # For pollux/lib/anoncreds/src/main/c
- JAVA_CHECKSTYLE # For pollux/lib/anoncreds/src/main/java
- GHERKIN_GHERKIN_LINT
- OPENAPI_SPECTRAL
# For python, disable all except PYTHON_BLACK linter
- PYTHON_PYLINT
- PYTHON_FLAKE8
Expand All @@ -33,7 +34,6 @@ DISABLE_LINTERS:
DISABLE_ERRORS_LINTERS:
- KOTLIN_KTLINT
- PROTOBUF_PROTOLINT
- OPENAPI_SPECTRAL
- MARKDOWN_MARKDOWN_LINK_CHECK

DISABLE: [COPYPASTE, SPELL, CREDENTIALS]
Expand All @@ -56,10 +56,12 @@ PRE_COMMANDS:
cwd: "workspace"

# Linter customisation
MARKDOWN_MARKDOWN_LINK_CHECK_FILTER_REGEX_EXCLUDE: "CHANGELOG.md"
MARKDOWN_MARKDOWNLINT_FILTER_REGEX_EXCLUDE: "CHANGELOG.md"
MARKDOWN_MARKDOWN_LINK_CHECK_FILTER_REGEX_EXCLUDE: CHANGELOG\.md|DEPENDENCIES\.md
MARKDOWN_MARKDOWNLINT_FILTER_REGEX_EXCLUDE: CHANGELOG\.md|DEPENDENCIES\.md
MARKDOWN_MARKDOWN_TABLE_FORMATTER_FILTER_REGEX_EXCLUDE: CHANGELOG\.md|DEPENDENCIES\.md
SQL_SQL_LINT_ARGUMENTS: -d postgres --ignore-errors=postgres-invalid-alter-option,postgres-invalid-create-option,postgres-invalid-drop-option
YAML_YAMLLINT_FILTER_REGEX_EXCLUDE: "infrastructure/charts/agent/*|cloud-agent/service/api/http/*|examples/*"
YAML_PRETTIER_FILTER_REGEX_EXCLUDE: "infrastructure/charts/agent/*|cloud-agent/service/api/http/*|examples/*"
YAML_V8R_FILTER_REGEX_EXCLUDE: "infrastructure/charts/agent/*"
JAVASCRIPT_STANDARD_FILTER_REGEX_EXCLUDE: "tests/performance-tests/agent-performance-tests-k6/src/k6chaijs.js"
BASH_SHELLCHECK_FILTER_REGEX_EXCLUDE: "infrastructure/*"
18 changes: 10 additions & 8 deletions examples/.nickel/build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
find . -name "*.ncl" | xargs -I _ nickel format _
#!/usr/bin/env bash

nickel export ./root.ncl -f yaml --field st > ../st/compose.yaml
nickel export ./root.ncl -f yaml --field st-vault > ../st-vault/compose.yaml
nickel export ./root.ncl -f yaml --field st-multi > ../st-multi/compose.yaml
nickel export ./root.ncl -f yaml --field st-oid4vci > ../st-oid4vci/compose.yaml
find . -name "*.ncl" -print0 | xargs -0 -I _ nickel format _

nickel export ./root.ncl -f yaml --field mt > ../mt/compose.yaml
nickel export ./root.ncl -f yaml --field mt-keycloak > ../mt-keycloak/compose.yaml
nickel export ./root.ncl -f yaml --field mt-keycloak-vault > ../mt-keycloak-vault/compose.yaml
nickel export ./root.ncl -f yaml --field st >../st/compose.yaml
nickel export ./root.ncl -f yaml --field st-vault >../st-vault/compose.yaml
nickel export ./root.ncl -f yaml --field st-multi >../st-multi/compose.yaml
nickel export ./root.ncl -f yaml --field st-oid4vci >../st-oid4vci/compose.yaml

nickel export ./root.ncl -f yaml --field mt >../mt/compose.yaml
nickel export ./root.ncl -f yaml --field mt-keycloak >../mt-keycloak/compose.yaml
nickel export ./root.ncl -f yaml --field mt-keycloak-vault >../mt-keycloak-vault/compose.yaml
26 changes: 13 additions & 13 deletions examples/.nickel/stack.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ in
version = V.hurl,
hurlDir = "./bootstrap",
variables = {
HURL_keycloak_base_url = "http://external-keycloak-%{args.name}:8080",
HURL_keycloak_admin_user = "admin",
HURL_keycloak_admin_password = "admin",
HURL_keycloak_realm = args.realm,
HURL_alice_username = "alice",
HURL_alice_password = "1234",
HURL_alice_wallet_client_id = "alice-wallet",
HURL_KEYCLOAK_BASE_URL = "http://external-keycloak-%{args.name}:8080",
HURL_KEYCLOAK_ADMIN_USER = "admin",
HURL_KEYCLOAK_ADMIN_PASSWORD = "admin",
HURL_KEYCLOAK_REALM = args.realm,
HURL_ALICE_USERNAME = "alice",
HURL_ALICE_PASSWORD = "1234",
HURL_ALICE_WALLET_CLIENT_ID = "alice-wallet",
}
},
}
Expand Down Expand Up @@ -200,12 +200,12 @@ in
version = V.hurl,
hurlDir = "../.shared/hurl/simple_realm",
variables = {
HURL_keycloak_base_url = "http://%{hosts.keycloak}:8080",
HURL_keycloak_admin_user = "admin",
HURL_keycloak_admin_password = "admin",
HURL_keycloak_realm = "identus",
HURL_keycloak_client_id = "agent",
HURL_keycloak_client_secret = "agent-secret",
HURL_KEYCLOAK_BASE_URL = "http://%{hosts.keycloak}:8080",
HURL_KEYCLOAK_ADMIN_USER = "admin",
HURL_KEYCLOAK_ADMIN_PASSWORD = "admin",
HURL_KEYCLOAK_REALM = "identus",
HURL_KEYCLOAK_CLIENT_ID = "agent",
HURL_KEYCLOAK_CLIENT_SECRET = "agent-secret",
}
},
}
Expand Down
4 changes: 2 additions & 2 deletions examples/.shared/postgres/init-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ function create_user_and_database() {

if [ -n "$POSTGRES_MULTIPLE_DATABASES" ]; then
echo "Multiple database creation requested: $POSTGRES_MULTIPLE_DATABASES"
for db in $(echo $POSTGRES_MULTIPLE_DATABASES | tr ',' ' '); do
create_user_and_database $db
for db in $(echo "$POSTGRES_MULTIPLE_DATABASES" | tr ',' ' '); do
create_user_and_database "$db"
done
echo "Multiple databases created"
fi
12 changes: 6 additions & 6 deletions examples/mt-keycloak-vault/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ services:
- /hurl/*.hurl
- --test
environment:
HURL_keycloak_admin_password: admin
HURL_keycloak_admin_user: admin
HURL_keycloak_base_url: http://keycloak-default:8080
HURL_keycloak_client_id: agent
HURL_keycloak_client_secret: agent-secret
HURL_keycloak_realm: identus
HURL_KEYCLOAK_ADMIN_PASSWORD: admin
HURL_KEYCLOAK_ADMIN_USER: admin
HURL_KEYCLOAK_BASE_URL: http://keycloak-default:8080
HURL_KEYCLOAK_CLIENT_ID: agent
HURL_KEYCLOAK_CLIENT_SECRET: agent-secret
HURL_KEYCLOAK_REALM: identus
image: ghcr.io/orange-opensource/hurl:4.2.0
volumes:
- ../.shared/hurl/simple_realm:/hurl
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
keycloak_admin_password=admin
keycloak_admin_user=admin
keycloak_base_url=http://localhost:8080/keycloak
keycloak_realm=identus
keycloak_admin_user=admin
keycloak_admin_password=admin

agent_url=http://localhost:8080

issuer_username=alice
issuer_password=1234
issuer_username=alice

holder_username=bob
holder_password=1234
holder_username=bob

verifier_username=john
verifier_password=1234
verifier_username=john
12 changes: 6 additions & 6 deletions examples/mt-keycloak/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ services:
- /hurl/*.hurl
- --test
environment:
HURL_keycloak_admin_password: admin
HURL_keycloak_admin_user: admin
HURL_keycloak_base_url: http://keycloak-default:8080
HURL_keycloak_client_id: agent
HURL_keycloak_client_secret: agent-secret
HURL_keycloak_realm: identus
HURL_KEYCLOAK_ADMIN_PASSWORD: admin
HURL_KEYCLOAK_ADMIN_USER: admin
HURL_KEYCLOAK_BASE_URL: http://keycloak-default:8080
HURL_KEYCLOAK_CLIENT_ID: agent
HURL_KEYCLOAK_CLIENT_SECRET: agent-secret
HURL_KEYCLOAK_REALM: identus
image: ghcr.io/orange-opensource/hurl:4.2.0
volumes:
- ../.shared/hurl/simple_realm:/hurl
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
keycloak_admin_password=admin
keycloak_admin_user=admin
keycloak_base_url=http://localhost:8080/keycloak
keycloak_realm=identus
keycloak_admin_user=admin
keycloak_admin_password=admin

agent_url=http://localhost:8080

issuer_username=alice
issuer_password=1234
issuer_username=alice

holder_username=bob
holder_password=1234
holder_username=bob

verifier_username=john
verifier_password=1234
verifier_username=john
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
issuer_url=http://localhost:8080
holder_url=http://localhost:8081
issuer_url=http://localhost:8080
verifier_url=http://localhost:8082
14 changes: 7 additions & 7 deletions examples/st-oid4vci/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ services:
- /hurl/*.hurl
- --test
environment:
HURL_alice_password: '1234'
HURL_alice_username: alice
HURL_alice_wallet_client_id: alice-wallet
HURL_keycloak_admin_password: admin
HURL_keycloak_admin_user: admin
HURL_keycloak_base_url: http://external-keycloak-issuer:8080
HURL_keycloak_realm: students
HURL_ALICE_PASSWORD: '1234'
HURL_ALICE_USERNAME: alice
HURL_ALICE_WALLET_CLIENT_ID: alice-wallet
HURL_KEYCLOAK_ADMIN_PASSWORD: admin
HURL_KEYCLOAK_ADMIN_USER: admin
HURL_KEYCLOAK_BASE_URL: http://external-keycloak-issuer:8080
HURL_KEYCLOAK_REALM: students
image: ghcr.io/orange-opensource/hurl:4.2.0
volumes:
- ./bootstrap:/hurl
Expand Down
4 changes: 3 additions & 1 deletion examples/st-oid4vci/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ def holder_get_issuer_metadata(credential_issuer: str):
def override_host(url):
return url.replace("http://caddy-issuer:8080/prism-agent", AGENT_URL)

metadata_url = override_host(f"{credential_issuer}/.well-known/openid-credential-issuer")
metadata_url = override_host(
f"{credential_issuer}/.well-known/openid-credential-issuer"
)
response = requests.get(metadata_url).json()
response["credential_endpoint"] = override_host(response["credential_endpoint"])
response["credential_issuer"] = override_host(response["credential_issuer"])
Expand Down

0 comments on commit 0eff8cb

Please sign in to comment.