document the v0.1.0 surface with a quickstart and runnable examples#12
Merged
Conversation
The library is feature-complete: the typed SET envelope, Parse, Validate, Encode, and the event-type registry all ship. What was missing was the documentation a developer needs to use it without reading the source — this fills that gap ahead of the v0.1.0 tag. README gains a three-part quickstart, each block a focused flow: parse already-verified claims-set bytes and walk events (decoding the recognized ones, leaving unknown event types raw), build and Encode a SET, and register an event type through the registry. The "what this is / is not" framing, the RFC 8417 §4 "a SET is not an access token" caveat, and the pre-release version-stability statement are kept; the §4 caveat now also notes that a validated SET carries no "good for auth" semantics. The sub_id claim is cross-referenced to its public dependency by import path. example_test.go adds runnable Example functions for the flows that lacked one — ExampleParse, Example_encode, Example_registerEventType (implement Event, register a decoder, recover the typed value via Typed), a contrasting unregistered-URI-stays-raw example, and a Validate-boundary example matching the §2.2 sentinels with errors.Is. The existing ExampleSET_Validate and ExampleAudience are left alone. The registry example claims a documentation-only event-type URI distinct from the CAEP/RISC URIs and other fixtures already registered in the test binary, since the registry has no unregister. CHANGELOG gains a dated [0.1.0] section summarizing the shipped surface and the compare/release links. The SET type's doc comment dropped a stale "later building blocks" forward reference to Parse/Validate/Encode, which now exist. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Documentation polish ahead of the
v0.1.0tag. The library isfeature-complete (typed
SETenvelope,Parse,Validate,Encode,the event-type registry); this adds the docs a developer needs to use
it from the public surface alone.
Changes
README.md— a three-part quickstart, each a focused flow:parse already-verified claims-set bytes and walk events (typed where
registered, raw where not), build and
Encodea SET, and register anevent type through the registry. Keeps the "what this is / is not"
framing, the RFC 8417 §4 "a SET is not an access token" caveat (now
noting a validated SET carries no "good for auth" semantics), and the
pre-release version-stability statement.
sub_idis cross-referencedto its dependency by import path.
example_test.go— runnableExamplefunctions for the flowsthat lacked one:
ExampleParse,Example_encode,Example_registerEventType(implementEvent→ register →Typed),a contrasting unregistered-URI-stays-raw example, and a
Validate-boundary example matching the §2.2 sentinels witherrors.Is. ExistingExampleSET_Validate/ExampleAudienceareuntouched. The registry example uses a documentation-only event-type
URI distinct from the CAEP/RISC URIs already registered in the test
binary (the registry has no unregister).
CHANGELOG.md— dated[0.1.0]section summarizing the shippedsurface plus compare/release links.
secevent.go— drop a stale "later building blocks" forwardreference in the
SETdoc comment now thatParse/Validate/Encodeexist.
Verification
gofmt -l .clean,go vet ./...clean,go mod tidy -diffclean.go test -race -shuffle=on ./...passes (allExampleoutputsverified).
golangci-lint run ./...(v2.12.2): 0 issues.🤖 Generated with Claude Code