Skip to content

feat: InCommon attribute annotations, Examples button, and Authorization header fix - #62

Merged
kellenmurphy merged 4 commits into
mainfrom
feat/authn-context-and-xml-highlighting
May 25, 2026
Merged

feat: InCommon attribute annotations, Examples button, and Authorization header fix#62
kellenmurphy merged 4 commits into
mainfrom
feat/authn-context-and-xml-highlighting

Conversation

@kellenmurphy

Copy link
Copy Markdown
Owner

Summary

  • Attribute table badges — OIDs in the Released Attributes table are now annotated with R&S (REFEDS Research & Scholarship entity category) and eppn-scoped/eppn-unscoped badges, backed by a 35-entry attribute registry. Friendly names are filled from the registry when the assertion omits the FriendlyName attribute. OID column no longer wraps to two lines.
  • Examples button — always-visible dropdown in the top-right corner loads any of 10 pre-built, dynamically-generated example payloads (2 SAMLResponses, 2 SAMLRequests, 2 JWTs, Authorization header, redirect query string, POST binding form value, full redirect URL). Payloads are generated at click time with live timestamps so relative time labels are always current.
  • Authorization: Bearer fixdecodeJwt now correctly strips the full Authorization: Bearer HTTP header line, not just the Bearer scheme prefix. The input format was already detected as JWT but previously failed to decode.

New files

  • src/lib/attributes.ts — attribute registry and badge logic
  • src/lib/examples.ts — 10 example payload generators using pako + btoa

Test plan

  • Coverage maintained at 100% statements/branches/functions/lines (293 tests)
  • npx tsc --noEmit clean
  • npx eslint . --quiet clean
  • CI passes on GitHub Actions
  • Attribute badges visible in the attribute table for R&S attributes
  • eppn-scoped (purple) and eppn-unscoped (amber) badges display correctly
  • Examples button opens grouped dropdown; each example loads and decodes
  • Authorization: Bearer <token> pastes decode correctly as JWT
  • Copy link appears alongside Examples when content is loaded

@codecov

codecov Bot commented May 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

… attribute table

- Add ATTRIBUTE_REGISTRY mapping 35 common OIDs (eduPerson, inetOrgPerson, SCHAC,
  Grouper) to friendly names and REFEDS R&S entity-category membership
- Badge R&S attributes with a green tag (voluntary bilateral bundle; IdPs and SPs
  that have registered the R&S entity category in their metadata)
- Badge eduPersonPrincipalName as eppn-scoped (purple) when the value contains @scope,
  eppn-unscoped (amber) when it does not
- Fill friendly name column from the registry when the assertion omits FriendlyName
- Fix OID column: remove max-w-xs constraint, use whitespace-nowrap so OIDs render
  on a single line without wrapping
- Update saml.attributes tooltip to describe the badge semantics accurately
…payloads

Attribute table:
- Show R&S and eppn-scoped/unscoped badges below OID in the attribute name column
- Fill friendly name from registry when assertion omits FriendlyName attribute

Examples button (always visible, top-right of the decoder):
- Dropdown grouped by input category: SAMLResponse, SAMLRequest, JWT,
  Authorization header, Query string, Full URL
- Each example is generated fresh on click with live timestamps via pako deflateRaw
  (redirect binding) and btoa (POST binding), so relative time labels are always current
- Click outside closes the dropdown; chevron rotates when open
- Copy link appears alongside Examples when content is loaded
The page detected Authorization: Bearer input as JWT but decodeJwt only
stripped the Bearer scheme prefix, leaving the Authorization: field name
in the string — causing atob to throw on the first dot-segment. Strip the
header field name before the scheme prefix so the full header line round-trips
correctly.
Move InCommon attribute annotations from planned to shipped features.
Document the Examples button, the attribute badge semantics (R&S,
eppn-scoped/unscoped), the Authorization: Bearer header support in decodeJwt,
and add attributes.ts and examples.ts to the project structure table.
@kellenmurphy
kellenmurphy force-pushed the feat/authn-context-and-xml-highlighting branch from 97e7df5 to c0ff7a5 Compare May 25, 2026 18:42
@kellenmurphy
kellenmurphy merged commit 7b85bd5 into main May 25, 2026
5 checks passed
@kellenmurphy
kellenmurphy deleted the feat/authn-context-and-xml-highlighting branch May 25, 2026 18:44
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.

1 participant