Skip to content

Enhance README.md with Go import examples and clarify usage - #35

Merged
evgenyk merged 7 commits into
mainfrom
ev/improving_docs
Sep 8, 2025
Merged

Enhance README.md with Go import examples and clarify usage#35
evgenyk merged 7 commits into
mainfrom
ev/improving_docs

Conversation

@evgenyk

@evgenyk evgenyk commented Sep 8, 2025

Copy link
Copy Markdown
Contributor

Add Go import examples for the client_credentials, authorization_code, and jwt packages. Remove outdated usage instructions to streamline documentation and clarify token validation behavior in the OAuth2 flow.

@coderabbitai

coderabbitai Bot commented Sep 8, 2025

Copy link
Copy Markdown

Walkthrough

Documentation-only changes: root README Usage removed and external OAuth link added; jwt README reorganized (Go import guidance, validation behavior notes, features); added Go Imports sections to oauth2 authorization_code and client_credentials READMEs. No code or public API changes.

Changes

Cohort / File(s) Summary
Root README
README.md
Replaced "Usage" section: removed local go get/go mod tidy code block and inserted an external OAuth flows reference; Authorization Code Flow section retained.
JWT docs
jwt/README.md
Added "Learn More About JWTs", enhanced Features, renamed "Installation" → "Go Imports" with an import block, inserted validation-behavior notes after Quick Start, and added JWKS/validation details.
OAuth2 flow docs
Authorization Code
oauth2/authorization_code/README.md
Added a "Go Imports" section showing required (github.com/kinde-oss/kinde-go/oauth2/authorization_code) and optional (.../jwt) imports; no code changes.
OAuth2 flow docs
Client Credentials
oauth2/client_credentials/README.md
Added a "Go Imports" section showing required (github.com/kinde-oss/kinde-go/oauth2/client_credentials) and optional imports (CLI session store and .../jwt); documentation-only change.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ev/improving_docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
oauth2/client_credentials/README.md (1)

9-17: Imports section reads well; small consistency tweak.

Consider noting “jwt is only needed if WithTokenValidation(...) is used” (mirrors comments used elsewhere). Optional: show WithScopes("read:users") later in “Basic Usage” to avoid a zero-arg call in the first snippet.

jwt/README.md (1)

46-49: Nice clarification on validation caching; add one cautionary sentence.

Suggest appending: “Change validation options by re-parsing the token; mutating options after parsing has no effect on an existing token.”

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ebe395 and 89b60b0.

📒 Files selected for processing (4)
  • README.md (0 hunks)
  • jwt/README.md (2 hunks)
  • oauth2/authorization_code/README.md (1 hunks)
  • oauth2/client_credentials/README.md (1 hunks)
💤 Files with no reviewable changes (1)
  • README.md
🔇 Additional comments (2)
oauth2/authorization_code/README.md (1)

9-16: Good addition: explicit import guidance.

The required/optional split is clear and aligns with the examples below.

jwt/README.md (1)

13-19: Import block LGTM.

Matches package path used throughout and reduces confusion vs. go get instructions.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 8, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
jwt/README.md (3)

5-18: Nice addition; add standards references for completeness.

Consider adding RFC links to anchor the guidance in specs.

 This guide covers:
 ...
 - JWT benefits compared to other token types
+ - Standards: RFC 7519 (JWT) and RFC 7517 (JWKS)

27-33: Import alias tip to avoid jwt name collision with golang-jwt/jwt.

Many users will import github.com/golang-jwt/jwt/v5 as well. Suggest showing an alias to avoid clashing identifiers.

 ## Go Imports

 ```go
-import (
-    "github.com/kinde-oss/kinde-go/jwt" // required
-)
+import (
+    "github.com/kinde-oss/kinde-go/jwt" // required
+    // If you also import github.com/golang-jwt/jwt/v5, consider aliasing one of them to avoid name collisions:
+    // kindejwt "github.com/kinde-oss/kinde-go/jwt"
+    // golangjwt "github.com/golang-jwt/jwt/v5"
+)

Also consider a one-line note below the block: “If you use github.com/golang-jwt/jwt/v5 in the same file, alias one of the imports (e.g., kindejwt or golangjwt) to avoid identifier conflicts.”

---

`60-63`: **Clarify caching semantics vs. time-based validity and confirm OAuth2 re-validation**  
- Token validation (signature, exp/nbf, audience, algorithm) runs once in ParseOAuth2Token; Token.IsValid() and GetSubject/GetIssuer/etc. read cached results and do not re-check exp/nbf on each call—long-lived Token objects must be re-parsed or refreshed to catch expiration.  
- ClientCredentials and AuthorizationCode flows invoke ParseOAuth2Token on every TokenSource retrieval, ensuring a fresh parse & re-validation each time you call GetToken or use the OAuth2 client.

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used**: CodeRabbit UI

**Review profile**: CHILL

**Plan**: Pro

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 89b60b03695cd37035c8cfb0ec9e1c257ee4eb60 and 4b5df74c39848b48164614765209c0fa37509e64.

</details>

<details>
<summary>📒 Files selected for processing (2)</summary>

* `README.md` (1 hunks)
* `jwt/README.md` (3 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* README.md

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@evgenyk
evgenyk merged commit f0c91c1 into main Sep 8, 2025
4 checks passed
@evgenyk
evgenyk deleted the ev/improving_docs branch September 8, 2025 07:29
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