Skip to content
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

ALS-4465: Add access rule for search values endpoint #50

Open
wants to merge 4 commits into
base: paul-non-FISMA
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions app-infrastructure/configs/pic-sure-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,29 @@ VALUES (
false
);

INSERT INTO accessRule_privilege (privilege_id, accessRule_id)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Investigate why this is not needed and if it should be

SELECT privilege.uuid, unhex(@uuidGate) from privilege, role_privilege, role
where privilege.uuid = role_privilege.privilege_id
AND role_privilege.role_id = role.uuid
AND role.name = 'FENCE_ROLE_OPEN_ACCESS';


SET @searchValuesAccessRuleUUID = REPLACE(uuid(),'-','');
INSERT INTO access_rule (uuid, name, description, rule, type, value, checkMapKeyOnly, checkMapNode, subAccessRuleParent_uuid, isEvaluateOnlyByGates, isGateAnyRelation)
VALUES (
unhex(@infoAccessRuleUUID),
'ALLOW_SEARCH_VALUES_ACCESS',
'Allow access to search values endpoint',
'$.path',
11,
'/search/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/values',
false,
true,
NULL,
true,
false
);

INSERT INTO accessRule_privilege (privilege_id, accessRule_id)
SELECT privilege.uuid, unhex(@uuidGate) from privilege, role_privilege, role
where privilege.uuid = role_privilege.privilege_id
Expand Down