Skip to content

Commit

Permalink
Merge pull request #426 from authzed/fix-lookup-and-add-deprecation
Browse files Browse the repository at this point in the history
Fix lookup and add deprecation warning
  • Loading branch information
tstirrat15 authored Oct 3, 2024
2 parents db39191 + 6962cdc commit ceb5e31
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/commands/permission.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,13 @@ func RegisterPermissionCmd(rootCmd *cobra.Command) *cobra.Command {
expandCmd.Flags().String("revision", "", "optional revision at which to check")
registerConsistencyFlags(expandCmd.Flags())

// NOTE: `lookup` is an alias of `lookup-resources` (below)
// and must have the same list of flags in order for it to work.
permissionCmd.AddCommand(lookupCmd)
lookupCmd.Flags().Bool("json", false, "output as JSON")
lookupCmd.Flags().String("revision", "", "optional revision at which to check")
lookupCmd.Flags().String("caveat-context", "", "the caveat context to send along with the lookup, in JSON form")
lookupCmd.Flags().Uint32("page-limit", 0, "limit of relations returned per page")
registerConsistencyFlags(lookupCmd.Flags())

permissionCmd.AddCommand(lookupResourcesCmd)
Expand Down Expand Up @@ -156,6 +159,7 @@ var lookupCmd = &cobra.Command{
Args: cobra.ExactArgs(3),
ValidArgsFunction: GetArgs(ResourceType, Permission, SubjectID),
RunE: lookupResourcesCmdFunc,
Deprecated: "prefer lookup-resources",
Hidden: true,
}

Expand Down

0 comments on commit ceb5e31

Please sign in to comment.