Document how to add authentication - #155
Open
koppen wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new documentation contains inaccurate statements (e.g., about Uchi::Current and “all controllers” coverage) that could mislead users implementing authentication.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds documentation explaining how to integrate application-level authentication with Uchi, and links the new page into the docs navigation.
Changes:
- Introduces a new
docs/authentication.mdguide with an example based on Rails’ authentication generator patterns. - Adds an “Authentication” entry to
docs/_sidebar.ymlso the page appears in the documentation sidebar.
File summaries
| File | Description |
|---|---|
| docs/authentication.md | New authentication guide for restricting access to Uchi controllers and describing current-user access. |
| docs/_sidebar.yml | Adds the new Authentication page to the sidebar navigation. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -0,0 +1,42 @@ | |||
| # Authentication | |||
|
|
|||
| As with everything Uchi tries to assume as little as possible about your application, therefore authentication is also up to you. This means you continue to use whatever authentication mechanism you've already implemented, be it HTTP Basic Authentication, Devise, Rails' authentication generator, or something entirely different. | |||
Comment on lines
+11
to
+12
| To restrict access to all Uchi-controllers, add an `Uchi::ApplicationController` at `app/controllers/uchi/application_controller.rb`: | ||
|
|
Comment on lines
+40
to
+42
| Uchi exposes a [Uchi::Current](https://api.rubyonrails.org/classes/ActiveSupport/CurrentAttributes.html) class which includes the currently logged in user at `Uchi::Current.user`. | ||
|
|
||
| By default Uchi gets the user using the global `current_user` method, so it should work with Devise and most Rails authentication systems. |
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.
No description provided.