This repository was archived by the owner on Aug 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Refactor users service #70
Merged
Merged
Changes from all commits
Commits
Show all changes
4 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 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| <% if (users && users.length != 0) { %> | ||
| <h2>Members</h2> | ||
| <table class="table table-striped" id="user-approval-table" class="dynatable-container"> | ||
| <thead> | ||
| <tr> | ||
| <th>Action</th> | ||
| <th>Netid</th> | ||
| <th>First Name</th> | ||
| <th>Last Name</th> | ||
| <th>A Member Since</th> | ||
| <tr> | ||
| </thead> | ||
| <tbody> | ||
| <% for (var user of users) { %> | ||
| <tr> | ||
| <td> | ||
| <% if (!user.is_member && user.netid != me.netid) { %> | ||
| <a class="button" onClick="makeACMMember('<%= user.netid %>')">Paid</a> | ||
| <a class="button" onClick="deleteACMMember('<%= user.netid %>')">Delete</a> | ||
| <% } else { %> | ||
| <p>No action to take.</p> | ||
| <% } %> | ||
| </td> | ||
| <td><%= user.netid %></td> | ||
| <td><%= user.first_name %></td> | ||
| <td><%= user.last_name %></td> | ||
| <td><%= new Date(user.created_at).toLocaleString() %></td> | ||
| </tr> | ||
| <% } %> | ||
| </tbody> | ||
| </table> | ||
| <% } else { %> | ||
| <h5>You have no users. That's a problem.</h5> | ||
| <% } %> |
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
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
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.
So one cool thing that affects development is that we no longer have to connect to the production database on the acm server to login to the website. Now, in development, the users service talks to crowd with the credentials and basically does a find or create User (fetching additional info like their name automatically) and returning it along with the session token.
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.
Sounds cool, can you explain more? Is login still hitting crowd directly or is it behind users now?
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.
from my understanding, Crowd would be behind users, so login would go through user-service
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.
Yes, login is behind users service now. I think we want the eventual goal to be that only users service talks to crowd. @bcongdon and I discussed this previously and we believe that would be best practice. For example, it would move the logic of the
validation-factorsbody that needs to be there for any crowd request to go to the users service. And it would make the users service actually behave as a service for all things users.Uh oh!
There was an error while loading. Please reload this page.
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 main requirement is the interface is simple enough that if you only need auth there is a straight forward route. The only concern I have is if we throw out crowd or we throw out the users service that a massive amount of functionality goes out with it since the two are very closely tied now
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 crowd served only as a session provider and users was a members store, coupling them makes sense in the ad context but is mixing roles in the service context