-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a simple change that exercises the basic function of group membership. There is a new user, a group, a membership for the user in the group, and a grant for the group to the by-username collection. The group ID is not auto-incrementing, so we assign one that can be used in production and stay out of the way. The finer details of groups are fully tested at the API level; this is for basic coverage and A/B testing.
- Loading branch information
Showing
6 changed files
with
79 additions
and
14 deletions.
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
lauth-allowed:$apr1$p.sxKRK5$KgXJ3DmjWUAjPWDT.MXgD0 | ||
lauth-denied:$apr1$QGNY5c50$KYz8u1TVMyKtPJqQnjRTM1 | ||
lauth-inst-member:$apr1$OlwhNzKS$pAko/dHzrwwLhirtsMyDb/ | ||
lauth-group-member:$apr1$hb0MeJ4P$6/scL5/84n6YOXqSbmzBo. |
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,19 @@ | ||
require "base64" | ||
|
||
RSpec.describe "Access to resources restricted to named group member" do | ||
include BasicAuth | ||
|
||
context "when logged in as a group member" do | ||
it "is allowed" do | ||
response = website.get("/restricted-by-username/") do |req| | ||
req.headers["Authorization"] = basic_auth_group_member | ||
end | ||
|
||
expect(response.status).to eq HttpCodes::OK | ||
end | ||
end | ||
|
||
def website | ||
@website ||= Faraday.new(TestSite::URL) | ||
end | ||
end |
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 |
---|---|---|
|
@@ -14,4 +14,8 @@ def another_good_user | |
def inst_user | ||
"lauth-inst-member" | ||
end | ||
|
||
def group_user | ||
"lauth-group-member" | ||
end | ||
end |
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