-
Notifications
You must be signed in to change notification settings - Fork 550
Generate service accounts when registering scanner webhooks #24325
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
Conversation
5a546a6 to
a2da4eb
Compare
a2da4eb to
2163a86
Compare
2163a86 to
198ee61
Compare
| @@ -256,6 +257,21 @@ class ScannerWebhook(ModelBase): | |||
| class Meta: | |||
| db_table = 'scanners_webhooks' | |||
|
|
|||
| def save(self, *args, **kwargs): | |||
| UserProfile.objects.get_or_create_service_account( | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also automatically delete it if the ScannerWebhook gets deleted ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I didn't link scanner webhooks with UserProfile precisely to not have to delete the accounts when the ScannerWebhook is deleted but I am wondering if this is good. Though, my approach to this would be to keep things simple for now, and iterate.
09bc9cd to
e952968
Compare
|
Updated! |
Fixes mozilla/addons#15944
While this creates a service account automatically (with JWT/AMO API
keys), configuring the groups/permissions remains a manual process
because every service is going to be different.