-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/auth and quality hub api #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 22 commits
362b17a
0ae5443
81d61ff
d5549f6
e8d58ad
f67c467
520fd8c
e08cdaf
6e1d1ae
da8c5c7
788cfcf
755b399
a2fe327
50e2519
d09dfe4
6925b19
30d450a
f2c7c6b
b1a8dfc
4816dea
fc2a8a6
0fa223b
10a1fc5
657c9f9
970cdde
e2f6c66
f4d34c9
31a262c
eb7178c
1ded191
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,6 +140,58 @@ If the license check fails, the server exits with a clear error message explaini | |
|
|
||
| --- | ||
|
|
||
| ## Authentication — Quality Hub API | ||
|
|
||
| The `provar.testcase.validate` tool can run in two modes depending on whether an API key is configured. | ||
|
|
||
| | Mode | When | What you get | | ||
| |---|---|---| | ||
| | **Quality Hub API** | API key configured | 170+ rules, quality score, tier-specific thresholds | | ||
| | **Local only** | No key | Structural/schema rules only | | ||
|
|
||
| The `validation_source` field in every `provar.testcase.validate` response tells you which mode fired: | ||
|
|
||
| | Value | Meaning | | ||
| |---|---| | ||
| | `quality_hub` | Full API validation — key is valid and the API responded | | ||
| | `local` | No key configured — local rules only | | ||
| | `local_fallback` | Key is configured but the API was unreachable or returned an error — local rules used as fallback | | ||
|
|
||
| When `validation_source` is `local_fallback`, a `validation_warning` field is also returned explaining why. | ||
|
|
||
| ### Configuring an API key | ||
|
|
||
| **Interactive login (recommended):** | ||
| ```sh | ||
| sf provar auth login | ||
| ``` | ||
| Opens a browser to the Provar login page. After you authenticate, the key is stored automatically at `~/.provar/credentials.json`. | ||
|
|
||
| **Check current status:** | ||
| ```sh | ||
| sf provar auth status | ||
| ``` | ||
|
|
||
| **CI/CD — environment variable:** | ||
| ```sh | ||
| export PROVAR_API_KEY=pv_k_your_key_here | ||
| ``` | ||
| The env var takes priority over any stored key. Keys must start with `pv_k_` — any other value is ignored. | ||
|
|
||
| **Remove stored key:** | ||
| ```sh | ||
| sf provar auth clear | ||
| ``` | ||
|
|
||
| ### Environment variables | ||
|
|
||
| | Variable | Purpose | Default | | ||
| |---|---|---| | ||
| | `PROVAR_API_KEY` | API key for Quality Hub validation | None — falls back to `~/.provar/credentials.json` | | ||
| | `PROVAR_QUALITY_HUB_URL` | Override the Quality Hub API base URL | Production URL | | ||
|
|
||
| --- | ||
|
|
||
| ## Path security | ||
|
|
||
| All file-system operations (read, write, generate) are restricted to the paths supplied via `--allowed-paths`. Any attempt to access a path outside those roots is rejected with a `PATH_NOT_ALLOWED` error. Path traversal sequences (`../`) are blocked with a `PATH_TRAVERSAL` error. | ||
|
|
@@ -306,6 +358,8 @@ Validates an XML test case for schema correctness (validity score) and best prac | |
| | `issues` | array | Schema issues with `rule_id`, `severity`, `message` | | ||
| | `best_practices_violations` | array | Best-practices violations with `rule_id`, `severity`, `weight`, `message` | | ||
| | `best_practices_rules_evaluated` | integer | How many best-practices rules were checked | | ||
| | `validation_source` | string | `quality_hub`, `local`, or `local_fallback` — see Authentication section | | ||
| | `validation_warning` | string | Present when `validation_source` is `local_fallback` — explains why | | ||
|
|
||
|
||
| **Key schema rules:** TC_001 (missing XML declaration), TC_002 (malformed XML), TC_003 (wrong root element), TC_010/011/012 (missing/invalid id/guid), TC_031 (invalid apiCall guid), TC_034/035 (non-integer testItemId). | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This docs table says the default for
PROVAR_QUALITY_HUB_URLis “Production URL”, butgetQualityHubBaseUrl()currently defaults to a/devAPI Gateway URL. Please align the documentation with the actual default (or update the code default if production is intended).