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

Add new commands for managing managed objects #467

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cparkertrivir
Copy link

This PR adds new commands for managing individual managed object configurations:

  • frodo idm schema managed export,
    • frodo idm schema object export -a: Exports all managed objects into a single file in the working directory.
    • frodo idm schema object export -A: Exports all managed objects into individual files in a new directory named managed.
    • frodo idm schema object export -i user_role: Exports the user_role managed object into its own file.
    • Also supports the flags -D to specify a destination directory and -f to specify a destination file.
  • frodo idm schema managed import
    • frodo idm schema object import -D dirName: Import managed objects that are saved in separate files from the specified directory.
    • frodo idm schema object import -f fileName: Import managed objects that are all contained in the same file from the specified file.
    • frodo idm schema object import -i -f fileName: Import the individual managed object from the specified file.

This PR is dependent on these PRs:
#461
rockcarver/frodo-lib#483

@cparkertrivir cparkertrivir marked this pull request as ready for review December 17, 2024 17:43
src/cli/idm/idm-schema-object-import.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@phalestrivir phalestrivir Dec 17, 2024

Choose a reason for hiding this comment

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

I'm not sure about the naming for the schema command. I'm wondering if there is a better way to do it, I feel like it isn't obvious that you would use schema for handling managed object config schema.

I have a few ideas of other alternatives to doing something like frodo idm schema export -AD managedSchema:

  1. frodo idm managed export -AD managedSchema: This one makes it more obvious that the command is for managing 'managed' object schema by renaming schema to managed.
  2. frodo idm object export -i managed -AD managedSchema: This one is more generic, and would work for any idm config entity that has a list of objects (e.g. sync, internal, managed, privileges, router, alphaOrgPrivileges). It would allow you to export them all separately like we do with managed.json or sync.json in the normal idm export command. If we wanted to export a single one, that could look like frodo idm object export -i managed -n alpha_user where you specify the name of the object that you are exporting after specifying the config entity it comes from.

I think I like option two the best it it would support many objects, and I think it's most similar to what @vscheuber was suggesting before. @vscheuber @hfranklin What do you guys think we should do for this? Should we have it remain as the schema command, or switch it to something like managed or object commands?

src/cli/idm/idm-schema-object-export.ts Outdated Show resolved Hide resolved
@cparkertrivir cparkertrivir force-pushed the feature/new-managed-object-commands branch from b95f2fc to c329172 Compare December 18, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants