Skip to content

Commit

Permalink
Create lauth-inst-member
Browse files Browse the repository at this point in the history
* Create lauth-inst-member
* Change user passwords to be the usernames
  • Loading branch information
malakai97 committed Dec 7, 2023
1 parent 703e07d commit d9832f1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
25 changes: 22 additions & 3 deletions db/test-fixture.sql
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,31 @@ INSERT INTO aa_user VALUES(
'f'
);

---------- setup for user allowed via institution membership ----------
INSERT INTO aa_user VALUES(
'lauth-inst-member',NULL,'Lauth',NULL,'Test-inst-mem','lauth-inst-member',
NULL, -- org unit
'Library auth system test user - this user is an institution member',
'Ann Arbor','MI','48109-119',NULL,NULL,'Staff',NULL,
'!none', -- umich id, !none
'@umich.edu', -- password, @umich.edu MAY signify SSO
0,NULL,
CURRENT_TIMESTAMP,'root', -- modified
NULL, -- expiry
'f'
);

INSERT INTO aa_is_member_of_inst VALUES(
'lauth-allowed', @test_inst_id, CURRENT_TIMESTAMP, 'root', 'f'
'lauth-inst-member', @test_inst_id, CURRENT_TIMESTAMP, 'root', 'f'
);

INSERT INTO aa_may_access VALUES(
NULL,
NULL, NULL, @test_inst_id, 'lauth-by-username', CURRENT_TIMESTAMP, 'root', NULL, 'f'
);
-----------------------------------------------------------------------------

-- Individual grant to the by-username collection; may want to differentiate
-- the institutional user from individual user at some point
-- Individual grant to the by-username collection
INSERT INTO aa_may_access VALUES(
NULL,
'lauth-allowed', NULL, NULL, 'lauth-by-username', CURRENT_TIMESTAMP, 'root', NULL, 'f'
Expand Down
6 changes: 3 additions & 3 deletions test-site/htpasswd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
lauth:$apr1$jsvY6qvR$tC5VSjLy/jgUGquT1k4et1
lauth-allowed:$apr1$QKcjXMQ.$RtvlmxDGYwJ85cQqvLbSE0
lauth-denied:$apr1$uc2kQAMQ$yOebBMieKrMU/WICeijya.
lauth-allowed:$apr1$p.sxKRK5$KgXJ3DmjWUAjPWDT.MXgD0
lauth-denied:$apr1$QGNY5c50$KYz8u1TVMyKtPJqQnjRTM1
lauth-inst-member:$apr1$OlwhNzKS$pAko/dHzrwwLhirtsMyDb/
8 changes: 6 additions & 2 deletions test/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ class HttpCodes

module BasicAuth
def basic_auth_bad_user
"Basic #{Base64.urlsafe_encode64("lauth-denied:denied")}"
"Basic #{Base64.urlsafe_encode64("lauth-denied:lauth-denied")}"
end

def basic_auth_good_user
"Basic #{Base64.urlsafe_encode64("lauth-allowed:allowed")}"
"Basic #{Base64.urlsafe_encode64("lauth-allowed:lauth-allowed")}"
end

def basic_auth_inst_member
"Basic #{Base64.urlsafe_encode64("lauth-inst-member:lauth-inst-member")}"
end
end

Expand Down

0 comments on commit d9832f1

Please sign in to comment.