RHCLOUD-47155 Add guide for protecting API endpoints with Kessel#108
Merged
Conversation
Adds protect-endpoint.mdx how-to guide covering: - Defining service permissions in KSL schema - Initializing Kessel SDK clients across all supported languages - Implementing Check() and CheckForUpdate() permission checks - Integrating with web framework middleware patterns - Error handling with fail-closed security Includes complete code examples for Go, Python, Node.js, Ruby, and Java with proper imports, type signatures, and SDK method calls. Examples are organized in synchronized tabs for easy language switching. Links to related concept pages (consistency model, relationships) and uses LinkCard components for next steps navigation. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updates terminology and code patterns to match the kessel-examples repository: - Schema: notifications.ksl → myservice.ksl with @rbac.add_unified_permission - Permissions: notifications_integrations_* → myservice_integration_* - Resource naming: integrations (plural) → integration (singular) - Verbs: read/write → view/edit - Node.js: Add Allowed enum import and use Allowed.ALLOWED_TRUE All code examples now use identical patterns to the working examples in kessel-examples/examples/protect-endpoint, enabling seamless transition from guide to runnable code. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Refactors protect-endpoint guide to use the CodeExamples component pattern: - Created src/examples/protect-endpoint/ with middleware examples for all 5 languages - Uses region markers (setup, middleware, usage) consistently across all languages - Reduces MDX file size by 437 lines - Improves maintainability: code examples are now in runnable files - Follows same pattern as other guides (enable-tls, getting-started) - Adds link to complete example files in repository - Standardizes on 'TypeScript' label instead of 'Node.js' This makes the examples easier to test and maintain as standalone code. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
lennysgarage
left a comment
Contributor
There was a problem hiding this comment.
Guide reads really well, feels easy to follow and build on. Just left a few comments on some things I found
Co-authored-by: Jonathan Marcantonio <lennysgarage1@gmail.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.
Summary
Adds a comprehensive how-to guide for protecting API endpoints using Kessel's authorization system.
What's included
Check()vsCheckForUpdate()with consistency guaranteesCode quality
Related
Part of RHCLOUD-47155
🤖 Generated with Claude Code