-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rjm/remoteuser #42
Open
richmarisa
wants to merge
3
commits into
main
Choose a base branch
from
rjm/remoteuser
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Rjm/remoteuser #42
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
/* | ||
* The users' netid may be retrieved from an environment variable | ||
* populated by the Apache shibboleth module. | ||
* | ||
* The default env variable is REMOTE USER, but this may be e.g, | ||
* REDIRECT_REMOTE_USER on some servers, depending on how PHP is installed. | ||
* | ||
* This configuration allows configuration of the remote_user_variable so it | ||
* is not hardcoded in the application. | ||
* | ||
* In project code, use env(config('starterkit.remote_user_variable')) to retrieve the netid | ||
* | ||
* For local development without shibboleth, you can add | ||
* REMOTE_USER=<netid> | ||
* to your project .env file to set the user netid. | ||
* | ||
*/ | ||
'remote_user_variable' => env("REMOTE_USER_VARIABLE", "REMOTE_USER"), | ||
|
||
]; |
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR is a great idea. I just suggest to name it 'remote_user' instead of 'remote_user_variable'. I think 'remote_user_variable' is too long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I worried that it would be too confusing, but as long as people used env(config('starterkit.remote_user')) it would be ok. Thoughts, @woodseowl ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the long name is appropriate.
remote_user
as a name suggests to me that it is some kind of entity.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think '_variable' does not give any clue that it is local. Maybe 'remote_user_app' then?
Another question: do we need a separate "starterkit" config file? Would it be cleaner to use config/app.php. It is almost empty. We are using app.js and app.css for other application customizations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value is the name of the environment variable used by the server (Apache module / PHP), so it really is a variable. We could call it remote_user_environment_variable to be most clear. I think that @woodsowl's idea of putting this in its own package with the middleware is a good one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is in a package we don't have access to config/app.php. starterkit is the shortname of the package, so that is what the config fille is called. If we push this into it's own cu-auth package as Eric suggests, then it can go in cu-auth.php (or cuauth.php? I'm not sure what happens to the dash in the package template).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we all agree about location: config/cu-auth.php