feat(rbac): sdk workspace identifiers #226
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This change introduces unique identifiers for workspaces and updates the command-line interface's listing capabilities for both organizations and workspaces. Workspaces can now be created with an explicit identifier or have one automatically generated from their name. CLI lists for organizations and workspaces have been upgraded to use
richtables, providing a more structured and readable output that includes these new identifiers.Conventional Commit Breakdown
featworkspaceKey Changes
dreadnode/api/client.py):create_workspacemethod to accept and persist a uniqueidentifierfor new workspaces.dreadnode/api/models.py):__str__representation forWorkspaceandOrganizationmodels to include their respective identifiers.dreadnode/cli/rbac/organizations.py):showcommand to present organizations in a formattedrich.table.Table, displaying the name, identifier, and ID.dreadnode/cli/rbac/workspaces.py):_create_identifier_from_nameto generate slug-like identifiers from workspace names.createcommand to allow an optionalidentifierargument, defaulting to an auto-generated identifier if not provided. The command now also prints the newly created workspace using the new table format.showcommand to display workspaces in arich.table.Table, including the name, identifier, ID, and a suggesteddn.configure()command.Testing/Verification
Tested locally by running against related platform version
Generated Summary:
identifierfield to thecreate_workspacemethod inApiClient, enhancing workspace uniqueness.Workspacemodel to replaceslugwithidentifierfor better clarity and functionality.Workspacemodel now includes a string representation method that outputs the workspace name and identifier for improved logging and debugging.showmethod inorganizations.pyto display the newidentifieralongside the organization name and ID in a formatted table._create_identifier_from_nameinworkspaces.pyto generate a unique identifier based on the workspace name.createcommand, if no identifier is provided, it will automatically generate one based on the workspace name, improving user experience.This summary was generated with ❤️ by rigging