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

Move to prod #613

Merged
merged 1 commit into from
Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ jobs:

cypress-run:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged == false && github.event.pull_request.draft == false && github.base_ref != 'prod' }}
env:
CYPRESS_RECORD_KEY: ${{ secrets.RECORDING_KEY }}
CYPRESS_username: ${{ secrets.CYPRESS_USER_NAME }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deployStatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ jobs:

cypress-run:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged == true && github.event.pull_request.draft == false && github.base_ref != 'prod' }}
env:
CYPRESS_RECORD_KEY: ${{ secrets.RECORDING_KEY }}
CYPRESS_username: ${{ secrets.CYPRESS_USER_NAME }}
Expand Down
10 changes: 5 additions & 5 deletions database/src/migrations/20210715170002_security_procedures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ $$;
declare

begin
perform ${DB_SCHEMA}.api_apply_security_rule(security_rule_id) from ${DB_SCHEMA}.security_rule;
perform ${DB_SCHEMA}.api_apply_security_rule(security_rule_id) from ${DB_SCHEMA}.security_rule where system_rule = false;
perform ${DB_SCHEMA}.api_security_maintenance();
end;
$BODY$;
Expand Down Expand Up @@ -365,7 +365,7 @@ $$;
execute format('select security_rule_id from ${DB_SCHEMA}.security_rule where rule_definition ->> ''target'' = lower(''%1$s'') and system_rule=true', __table_name) into v_security_rule_id;

-- Secure the record
execute format('select ${DB_SCHEMA}.api_secure_record(%1$s, lower(''%2$s''), %3$s, api_get_context_user_id(),%4$s)', __id,__table_name,v_security_rule_id, __project_id);
execute format('select ${DB_SCHEMA}.api_secure_record(%1$s, lower(''%2$s''), %3$s, NULL,%4$s)', __id,__table_name,v_security_rule_id, __project_id);

return true;
end;
Expand All @@ -374,7 +374,7 @@ $$;
ALTER FUNCTION ${DB_SCHEMA}.api_secure_attachment_record(integer, character varying, integer)
OWNER TO postgres;

CREATE OR REPLACE FUNCTION ${DB_SCHEMA}.api_unsecure_attachment_record(__table_name character varying, __security_token uuid)
CREATE OR REPLACE FUNCTION ${DB_SCHEMA}.api_unsecure_attachment_record(__table_name character varying, __security_token uuid)
RETURNS boolean
LANGUAGE 'plpgsql'
COST 100
Expand All @@ -396,8 +396,8 @@ $$;

begin

execute format('delete from ${DB_SCHEMA}.security where security_token = ''%1$s''', __security_token);
execute format('update ${DB_SCHEMA}.%1$s set security_token = null where security_token = ''%2$s''', __table_name, __security_token);
execute format('update ${DB_SCHEMA}.%1$s set security_token = null where security_token = (select security_token from ${DB_SCHEMA}.security where security_token = ''%2$s'' group by security_token having count(*) = 1)', __table_name, __security_token);
execute format('delete from ${DB_SCHEMA}.security where security_token = ''%1$s'' and security_rule_id in (select security_rule_id from ${DB_SCHEMA}.security_rule where system_rule = true)', __security_token);

return true;
end;
Expand Down
Binary file added testing/e2e/cypress/fixtures/shapes/1.zip
Binary file not shown.
Loading