Skip to content

DO NOT MERGE: Project branch for Generic Functions (Pilot Phase)#4308

Draft
reinkrul wants to merge 107 commits into
masterfrom
project-gf-pilot
Draft

DO NOT MERGE: Project branch for Generic Functions (Pilot Phase)#4308
reinkrul wants to merge 107 commits into
masterfrom
project-gf-pilot

Conversation

@reinkrul
Copy link
Copy Markdown
Member

@reinkrul reinkrul commented Jun 2, 2026

Pilot Phase branch for Generic Functions, branched from project-gf with master merged in. Kept separate from project-gf so the PoC branch's backwards compatibility stays untouched.

Merge resolution notes

Both project-gf and master independently implemented an RFC 7523 jwt-bearer flow; resolved as follows:

  • jwt-bearer flow — adopted master's design: two-VP flow gated by service_provider_subject_id + auth.experimental.jwtbearerclient. Dropped project-gf's single-VP grant negotiation.
  • Grant-type constant — consolidated to oauth.JwtBearerGrantType.
  • policy_id — dropped (request param, client signature, and OpenAPI field); the presentation definition is resolved from scope. API regenerated.
  • Preserved project-gf behavior — disabled access-token cache (credential-revocation testing), OpenIdCredentialIssuerMetadata / VerifiableCredentials client methods, server-side jwt-bearer handler, GrantTypes config, gorm pinned at v1.30.2.
  • Regenerated mocks and IAM API; go mod tidy reconciled dependencies.

Full test suite passes.

Assisted by AI

reinkrul and others added 28 commits April 13, 2026 15:04
Extract the Jaeger trace verification out of the rfc021 OAuth flow test
into a dedicated, simpler test with a single node. Keeps the rfc021 test
focused on OAuth and avoids coupling tracing verification to an unrelated
multi-node flow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ly, use traced endpoint

The node fails to start under strictmode without a SQL connection string, and
its internal HTTP binds to 127.0.0.1 by default. Also /status/health/metrics
are excluded from tracing middleware, so the test now hits an endpoint that
produces spans.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- SC1091 in tracing run-test.sh: disable directive (qlty doesn't run with -x)
- SC2086 on modified line in rfc021 do-test.sh: quote $REQUEST

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The node was stuck downloading IRMA schemes at startup on slower CI
runners, causing the container healthcheck to time out before HTTP was
ready. Switch to a nuts.yaml config that disables IRMA schema autoupdate
and restricts contract validators to 'dummy' (IRMA isn't used by this
test).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
handleAccessTokenRequest stopped filling InputDescriptorConstraintIdMap
after createAccessToken was refactored to take an AccessToken template,
causing the browser e2e Test_UserAccessToken_EmployeeCredential to fail
with an empty AdditionalProperties map on introspection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sets non-sensitive OAuth2 request params (grant_type, client_id, scope,
response_type, error) as attributes on the current OTEL span so traces
and logs can be filtered by them. Covers the token, authorize and
authorize-response endpoints. Logs the verbose oauth.error_description
separately to avoid high-cardinality trace attributes.

Assisted by AI
Extracts the shared helper from auth/api/iam into auth/oauth so both
the server-side token/authorize handlers and the outbound HTTPClient
token request attach oauth.grant_type, oauth.client_id, oauth.scope
and oauth.response_type to the current OTEL span.

Assisted by AI
Without an explicit span, oauth.SetSpanAttributes ran before otelhttp
created the HTTP span, so attributes landed on the parent handler
span (or were dropped when no parent existed) instead of on the
outbound token request span where they're useful.

Assisted by AI
When using mCSD for addressing, the OAuth token endpoint must be
provided to the AT-Request instead of being resolved via a DID-Document.
This commit adds a request param for this.
…l Request

Adds an optional credential_details JSON object to POST /internal/auth/v2/{subjectID}/request-credential.
The node uses it as the base body of the outgoing OpenID4VCI Credential Request and overlays its own
JWT proof on top. Lets the wallet integrate with issuers (e.g. AET SDK) that accept additional fields
in the Credential Request body beyond what OpenID4VCI v1.0 defines.

Closes #4233

Assisted by AI
Switch VerifiableCredentials to TestResponseCodeWithLog so the upstream
response body is surfaced in the logs, making it possible to diagnose
4xx/5xx responses from the credential endpoint.

Assisted by AI
The 1.0 spec wraps credentials in a "credentials" array; pre-1.0 drafts
returned a single "credential" string. Custom UnmarshalJSON on
CredentialResponse handles both, taking the first entry from the array
form and warning if the issuer returned more.

Assisted by AI
; Conflicts:
;	auth/api/iam/bearer_token.go
;	auth/api/iam/s2s_vptoken_test.go
;	auth/auth.go
;	auth/client/iam/client.go
;	auth/client/iam/openid4vp.go
;	auth/client/iam/openid4vp_test.go
;	auth/services/oauth/authz_server_test.go
;	auth/test.go
;	crypto/jwx/algorithm.go
;	crypto/jwx_test.go
; Conflicts:
;	auth/api/iam/openid4vci.go
;	auth/api/iam/openid4vci_test.go
;	auth/api/iam/session.go
;	auth/client/iam/client.go
;	docs/_static/auth/v2.yaml
;	docs/pages/release_notes.rst
When the OpenID4VCI credential endpoint returns a non-2xx status, log the
status code and response body (Warn) so issuance failures (e.g. 400) can be
diagnosed without enabling debug. The body is already buffered for
structured-error parsing, so no extra read.

Assisted by AI
Pilot branch carrying the master merge so project-gf stays untouched.

Conflict resolution (overlapping RFC 7523 jwt-bearer work on both sides):
- jwt-bearer flow: adopted master's design (two-VP flow gated by
  service_provider_subject_id + auth.experimental.jwtbearerclient).
  Dropped project-gf's single-VP grant negotiation.
- Consolidated grant-type constant to oauth.JwtBearerGrantType.
- Dropped policy_id (request param, client signature, OpenAPI field);
  the presentation definition is resolved from scope. Regenerated API.
- Preserved project-gf-only behavior: disabled access-token cache
  (credential-revocation testing), OpenIdCredentialIssuerMetadata /
  VerifiableCredentials client methods, server-side jwt-bearer handler,
  GrantTypes config, gorm pinned at v1.30.2.
- Regenerated mocks and IAM API after resolving.

Assisted by AI
@qltysh
Copy link
Copy Markdown
Contributor

qltysh Bot commented Jun 2, 2026

Qlty


Coverage Impact

⬇️ Merging this pull request will decrease total coverage on master by 0.59%.

Modified Files with Diff Coverage (28)

RatingFile% DiffUncovered Line #s
Coverage rating: C Coverage rating: C
auth/auth.go0.0%213-215
Coverage rating: A Coverage rating: A
auth/config.go100.0%
Coverage rating: A Coverage rating: B
core/tls.go0.0%76-80
Coverage rating: A Coverage rating: A
auth/cmd/cmd.go100.0%
Coverage rating: A Coverage rating: A
auth/api/iam/metadata.go100.0%
Coverage rating: B Coverage rating: B
auth/oauth/types.go0.0%234-236
Coverage rating: B Coverage rating: B
auth/api/iam/api.go74.5%240-249, 788-789
Coverage rating: A Coverage rating: B
auth/api/auth/v1/api.go95.0%280
Coverage rating: B Coverage rating: B
auth/api/iam/openid4vp.go74.1%391, 735-736...
Coverage rating: C Coverage rating: C
auth/client/iam/openid4vp.go100.0%
Coverage rating: C Coverage rating: C
auth/services/oauth/relying_party.go100.0%
Coverage rating: B Coverage rating: B
auth/api/iam/access_token.go86.4%77-79
Coverage rating: C Coverage rating: C
auth/openid4vci/client.go100.0%
Coverage rating: B Coverage rating: C
auth/client/iam/client.go71.3%242-243, 246-247...
Coverage rating: B Coverage rating: B
auth/api/iam/validation.go78.3%47-48, 51-52, 57-59...
New Coverage rating: D
auth/api/iam/types.go61.9%93-94, 97-98...
New Coverage rating: F
auth/oauth/tracing.go0.0%52-73
New Coverage rating: B
auth/api/iam/bearer_token.go93.1%83-84
Coverage rating: B Coverage rating: B
vcr/cmd/cmd.go0.0%44-45
Coverage rating: B Coverage rating: B
vcr/holder/sql_wallet.go100.0%
Coverage rating: A Coverage rating: B
vcr/credential/util.go0.0%122-132
Coverage rating: B Coverage rating: B
vcr/holder/presenter.go60.0%132-133, 139-140...
Coverage rating: A Coverage rating: B
vcr/credential/resolver.go0.0%47-51
Coverage rating: A Coverage rating: B
vcr/revocation/statuslist2021_verifier.go100.0%
New Coverage rating: F
vcr/credential/dezi.go44.1%24-26, 75-76, 80-81...
Coverage rating: C Coverage rating: C
vcr/vcr.go100.0%
Coverage rating: A Coverage rating: A
vcr/revocation/types.go100.0%
Coverage rating: A Coverage rating: A
vcr/verifier/verifier.go33.3%157-158
Total59.4%
🤖 Increase coverage with AI coding...
In the `project-gf-pilot` branch, add test coverage for this new code:

- `auth/api/auth/v1/api.go` -- Line 280
- `auth/api/iam/access_token.go` -- Line 77-79
- `auth/api/iam/api.go` -- Lines 240-249 and 788-789
- `auth/api/iam/bearer_token.go` -- Line 83-84
- `auth/api/iam/openid4vp.go` -- Lines 391, 735-736, 739-740, and 742-743
- `auth/api/iam/types.go` -- Lines 93-94, 97-98, 100-101, and 111-112
- `auth/api/iam/validation.go` -- Lines 47-48, 51-52, 57-59, and 81-83
- `auth/auth.go` -- Line 213-215
- `auth/client/iam/client.go` -- Lines 242-243, 246-247, 257-269, 351-352, 382-383, 394-395, 402-403, and 407-408
- `auth/oauth/tracing.go` -- Line 52-73
- `auth/oauth/types.go` -- Line 234-236
- `core/tls.go` -- Line 76-80
- `vcr/cmd/cmd.go` -- Line 44-45
- `vcr/credential/dezi.go` -- Lines 24-26, 75-76, 80-81, 86-87, 90-91, 122-248, 262-263, 301-302, 304-305, 309-310, 326-327, 329-330, 336-337, 340-341, 355, 364-367, 376-377, 384-385, 388-389, 393-394, 397-398, 401-402, and 425-486
- `vcr/credential/resolver.go` -- Line 47-51
- `vcr/credential/util.go` -- Line 122-132
- `vcr/holder/presenter.go` -- Lines 132-133, 139-140, 147-148, and 152-153
- `vcr/verifier/verifier.go` -- Line 157-158

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

Add project-gf-pilot to the build-images push/pull_request triggers so it
builds and pushes a branch-tagged image, same as project-gf.

Assisted by AI
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.

3 participants