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

Resource rename and delete #113

Merged
merged 9 commits into from
Nov 10, 2022
Merged

Conversation

byewokko
Copy link
Collaborator

@byewokko byewokko commented Nov 8, 2022

Closes #99
Closes #100

Introduce endpoints for renaming and deleting resources.

Known limitations: Deleted resources may still be present in existing sessions and ID tokens.

Soft-delete (suspend) resource

Resource is marked as deleted, but stays in the database. It is also unassigned from all roles.

DELETE /resource/<resource_name>

Undelete resource

Same endpoint as creating a new resource.

POST /resource/<resource_name>
{}

Hard-delete resource

Resource is actually deleted from the database. It is also unassigned from all roles.

DELETE /resource/<resource_name>?hard_delete=true

Rename resource

A shorthand for creating a new resource and deleting the old one.

PUT /resource/<old_resource_name>
{
  "name": "<new_resource_name>"
}

List roles with a specific resource

Tenant roles + global roles

GET /role/<tenant>?resource=<resource_name>

All roles (superuser only)

GET /role?resource=<resource_name>

Other changes

  • Soft-deleted resources are excluded from the resource list (GET /resource) by default. Add query parameter include_deleted=true to include them.

@byewokko byewokko added the enhancement New feature or request label Nov 8, 2022
@byewokko byewokko self-assigned this Nov 8, 2022
@byewokko byewokko requested a review from ateska November 8, 2022 14:16
@byewokko byewokko merged commit 584070b into main Nov 10, 2022
@byewokko byewokko deleted the feature/resource-rename-and-delete branch November 10, 2022 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to disable (soft-delete) resource Ability to rename resource
2 participants