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

Fix perms #418

Merged
merged 1 commit into from
Oct 16, 2023
Merged

Fix perms #418

merged 1 commit into from
Oct 16, 2023

Conversation

WcaleNieWolny
Copy link
Contributor

@WcaleNieWolny WcaleNieWolny commented Oct 14, 2023

Requires: Cap-go/CLI#175

@netlify
Copy link

netlify bot commented Oct 14, 2023

👷 Deploy request for webcapgo accepted.

Name Link
🔨 Latest commit 348c060
🔍 Latest deploy log https://app.netlify.com/sites/webcapgo/deploys/652ac04e1f509900088db220

@sonarcloud
Copy link

sonarcloud bot commented Oct 14, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@@ -0,0 +1,15 @@
BEGIN;
ALTER POLICY "allow apikey to select" ON "public"."apps" USING (is_allowed_capgkey(((current_setting('request.headers'::text, true))::json ->> 'capgkey'::text), '{all,write,upload,read}'::key_mode[], app_id));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to write this in more than one line? It's pretty hard to read everything in one single line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not know, I have copied this code from supabase and have not changed a bit. The truth is that we have even longer lines in base.sql so I would not risk breaking this

Comment on lines -2 to -5
ALTER TABLE devices DROP CONSTRAINT devices_version_fkey;
ALTER TABLE stats DROP CONSTRAINT logs_app_id_fkey;
ALTER TABLE stats DROP CONSTRAINT logs_device_id_fkey;
ALTER TABLE stats DROP CONSTRAINT logs_version_fkey;
Copy link
Contributor

Choose a reason for hiding this comment

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

does this change take effect? considering this already ran

Copy link
Contributor Author

@WcaleNieWolny WcaleNieWolny Oct 15, 2023

Choose a reason for hiding this comment

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

Martin broke base.sql and the supabase up was no longer working (because of the broken base.sql). I fixed the base.sql and then it threw an exception in this migration so I removed the lines that were causing the problems (The problem was that logs_app_id_fkey constraint did not exist)

Comment on lines -1887 to -1889
ALTER TABLE ONLY "public"."channel_devices"
ADD CONSTRAINT "channel_devices_pkey" PRIMARY KEY ("device_id");

Copy link
Contributor

Choose a reason for hiding this comment

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

does this change take effect? considering this already ran

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See, the thing is that I have not REALLY removed anything. This constraint is duplicated on this line and this line. Since you cannot have 2 constrains that are exactly the same I had to remove this line

Copy link
Contributor

@ologbonowiwi ologbonowiwi left a comment

Choose a reason for hiding this comment

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

thanks for the patience answering the comments.

LGTM

@riderx
Copy link
Contributor

riderx commented Oct 16, 2023

/tip $20 @ologbonowiwi

@riderx
Copy link
Contributor

riderx commented Oct 16, 2023

/tip $20 @WcaleNieWolny

@algora-pbc
Copy link

algora-pbc bot commented Oct 16, 2023

@ologbonowiwi: You just got a $20 tip! We'll notify you once it is processed.

@algora-pbc
Copy link

algora-pbc bot commented Oct 16, 2023

🎉🎈 @WcaleNieWolny has been awarded $20! 🎈🎊

@riderx riderx merged commit f6e57dd into Cap-go:main Oct 16, 2023
4 checks passed
@algora-pbc
Copy link

algora-pbc bot commented Oct 16, 2023

🎉🎈 @ologbonowiwi has been awarded $20! 🎈🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants