Skip to content

docs(contributing): document go-jose jwt builder pattern for OIDC tests #574

Description

@github-actions

Summary

Triggered by the merge of #564 (refactor(test): use go-jose jwt subpackage for OIDC token construction), which updated handler/oidc_test.go to use the idiomatic go-jose/v4/jwt builder API.

Changes

CONTRIBUTING.md — expands the "OIDC debugging tools" section with a new ### Constructing JWTs in tests subsection that:

  • Explains that OIDC tests use go-jose/v4/jwt (imported as josejwt) to build signed id_token values for fake providers
  • Shows the full import block and builder pattern (josejwt.Signed(signer).Claims(claimsMap).Serialize()) that was introduced in refactor(test): use go-jose jwt subpackage for OIDC token construction #564
  • Updates the existing note to distinguish production token verification (handled by coreos/go-oidc/v3 and golang-jwt/jwt/v5) from test token construction (handled by go-jose/v4 and its jwt subpackage)

Why

Without this documentation, contributors adding new OIDC test cases might revert to the old manual json.Marshal → signer.Sign → CompactSerialize pattern instead of using the idiomatic builder. Documenting the approved pattern in CONTRIBUTING.md closes that gap and keeps the test codebase consistent.

Testing

Documentation-only change. No production or test logic was modified.


Warning

Protected Files — Push Permission Denied

This was originally intended as a pull request, but the patch modifies protected files. A human must create the pull request manually.

Protected files
  • CONTRIBUTING.md

The push was rejected because GitHub Actions does not have workflows permission to push these changes, and is never allowed to make such changes, or other authorization being used does not have this permission.

Create the pull request manually
# Download the patch from the workflow run
gh run download 27784135684 -n agent -D /tmp/agent-27784135684

# Create a new branch
git checkout -b docs/oidc-test-jwt-construction-pattern-71aeb404d5b6fbd2 main

# Apply the patch (--3way handles cross-repo patches)
git am --3way /tmp/agent-27784135684/aw-docs-oidc-test-jwt-construction-pattern.patch

# Push the branch and create the pull request
git push origin docs/oidc-test-jwt-construction-pattern-71aeb404d5b6fbd2
gh pr create --title 'docs(contributing): document go-jose jwt builder pattern for OIDC tests' --base main --head docs/oidc-test-jwt-construction-pattern-71aeb404d5b6fbd2 --repo amalgamated-tools/goauth

Generated by Update Docs · 401 AIC · ⌖ 12.8 AIC · ⊞ 32.1K ·

Add this agentic workflows to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/update-docs.md@96b9d4c39aa22359c0b38265927eadb31dcf4e2a

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions