-
Notifications
You must be signed in to change notification settings - Fork 34
Feature/secret management (WIP) #506
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
base: main
Are you sure you want to change the base?
Conversation
…eature/secret-management
adds secret management UI
executor/models.py
Outdated
| class Meta: | ||
| constraints = [ | ||
| models.UniqueConstraint( | ||
| fields=['key', 'account', 'is_active'], |
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.
uniqueness should not be on 'is_active' column
Remove this
At the time of creation always check if an 'active' key with the same name exists and return an error if it does
At the time of deletion set the key name to '{key}#inactive#{timestamp}' and is_active to false. But only allow the person who has created the key to change the state or the value
executor/secrets/views.py
Outdated
| return value[:2] + "••••••" + value[-2:] | ||
|
|
||
|
|
||
| def _secret_to_proto(secret: Secret) -> SecretProto: |
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.
move this to mode class and make it a property
executor/secrets/views.py
Outdated
| is_active=secret.is_active | ||
| ) | ||
|
|
||
| def _secret_to_proto_partial(secret: Secret) -> SecretProto: |
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.
move this to mode class and make it a property
executor/secrets/views.py
Outdated
| secret_id = list(secret_ids)[0] | ||
|
|
||
| try: | ||
| secret = Secret.objects.get(id=secret_id, account=account, is_active=True) |
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.
make a crud layer for secrets model
executor/secrets/views.py
Outdated
| try: | ||
| secret = Secret.objects.get(id=secret_id, account=account, is_active=True) | ||
| try: | ||
| secrets_update_processor.update(secret, update_secret_ops) |
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.
updated_secrets should be returned by the update processor
droid-mohit
left a comment
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.
Secret updates should be allowed only to the creator. The update processor currently doesnt take care of this. Handle this.
|
@droid-mohit
|
No description provided.