Skip to content

sdx token, path validation and activity update - #270

Merged
ikethecoder merged 8 commits into
masterfrom
dev
Jul 22, 2026
Merged

sdx token, path validation and activity update#270
ikethecoder merged 8 commits into
masterfrom
dev

Conversation

@ikethecoder

@ikethecoder ikethecoder commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

This PR introduces route path-level validation for the Gateway API and brings the sdxStepTokenApi
OpenAPI spec into compliance with CSIT API governance standards.

Changes

Gateway API — Route Path Validation (APS-3732)

  • Added validate_route_paths / validate_route_path to utils/validators.py, enforcing that every route path
    in a published config matches a namespace's allowed perm-route-paths (error code e7).
  • Wired the new validation into both v1 and v2 write_config flows, gated by a per-data-plane
    enforce-route-paths flag.
  • Fixed a gateway event action type: publishedpublish on sync completion.
  • Added comprehensive test coverage: tests/routes/v1/test_sdx.py, tests/routes/v2/test_sdx.py, and
    tests/utils/test_validate_route_paths.py, plus test package __init__.py files and updated conftest.py /
    config/test.json.

sdxStepTokenApi — OpenAPI / Governance Compliance

  • Extracted request/response models into models.py (TokenRequest, TokenResponse, HTTPValidationError).
  • Renamed the endpoint /token/tokens, added operation_id and documented 200/422 responses.
  • Checked in a generated openapi.json spec and expanded app.py to support spec generation/serving.
  • Updated README, spec docs, and route tests.

CI / Tooling

  • Added .spectral.yaml extending the BCGov CSIT API governance ruleset for spec linting.
  • Updated pr-build.yml to use sonarqube-scan-action@v8.1.0 and fixed YAML indentation.

Paul Howells and others added 6 commits April 1, 2026 13:00
- implemented validation methods and unit tests
- added validation check to endpoints
)

* add .spectral.yaml

* fixes to meet style ruleset
APS-3732 Path-level validation for sdx related routes
* cleanup the action type

* fix sonarqube for pr
except Exception as ex:
traceback.print_exc()
log.error("%s - %s" % (namespace, " Route Path Validation Errors: %s" % ex))
abort_early(event_id, 'publish', namespace, jsonify(error="Validation Errors:\n%s" % ex))
except Exception as ex:
traceback.print_exc()
log.error("%s - %s" % (namespace, " Route Path Validation Errors: %s" % ex))
abort_early(event_id, 'publish', namespace, jsonify(error="Validation Errors:\n%s" % ex))
@sonarqubecloud

sonarqubecloud Bot commented Jun 3, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
38.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@ikethecoder ikethecoder changed the title validations and activity action type updates sdx token, path validation and activity update Jun 3, 2026
ikethecoder and others added 2 commits July 7, 2026 15:40
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
36.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@ikethecoder
ikethecoder merged commit a403dac into master Jul 22, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants