Skip to content

Commit 54f4359

Browse files
committed
breaking: Clean up deprecated functionality for v1
1 parent ce26ba6 commit 54f4359

File tree

5 files changed

+0
-63
lines changed

5 files changed

+0
-63
lines changed

internal/cmd/cmd.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ zed permission check --explain document:firstdoc writer user:emilia
124124

125125
relCmd := commands.RegisterRelationshipCmd(rootCmd)
126126

127-
commands.RegisterWatchCmd(rootCmd)
128127
commands.RegisterWatchRelationshipCmd(relCmd)
129128

130129
schemaCmd := commands.RegisterSchemaCmd(rootCmd)

internal/cmd/preview.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,9 @@ import (
66

77
func registerPreviewCmd(rootCmd *cobra.Command) {
88
rootCmd.AddCommand(previewCmd)
9-
10-
previewCmd.AddCommand(schemaCmd)
11-
12-
schemaCmd.AddCommand(schemaCompileCmd)
139
}
1410

1511
var previewCmd = &cobra.Command{
1612
Use: "preview <subcommand>",
1713
Short: "Experimental commands that have been made available for preview",
1814
}
19-
20-
var schemaCmd = &cobra.Command{
21-
Use: "schema <subcommand>",
22-
Short: "Manage schema for a permissions system",
23-
Deprecated: "please use `zed schema compile`",
24-
}

internal/commands/permission.go

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@ func consistencyFromCmd(cmd *cobra.Command) (c *v1.Consistency, err error) {
4747
c = &v1.Consistency{Requirement: &v1.Consistency_AtLeastAsFresh{AtLeastAsFresh: &v1.ZedToken{Token: atLeast}}}
4848
}
4949

50-
// Deprecated (hidden) flag.
51-
if revision := cobrautil.MustGetStringExpanded(cmd, "revision"); revision != "" {
52-
if c != nil {
53-
return nil, ErrMultipleConsistencies
54-
}
55-
c = &v1.Consistency{Requirement: &v1.Consistency_AtLeastAsFresh{AtLeastAsFresh: &v1.ZedToken{Token: revision}}}
56-
}
57-
5850
if exact := cobrautil.MustGetStringExpanded(cmd, "consistency-at-exactly"); exact != "" {
5951
if c != nil {
6052
return nil, ErrMultipleConsistencies
@@ -73,38 +65,24 @@ func RegisterPermissionCmd(rootCmd *cobra.Command) *cobra.Command {
7365

7466
permissionCmd.AddCommand(checkCmd)
7567
checkCmd.Flags().Bool("json", false, "output as JSON")
76-
checkCmd.Flags().String("revision", "", "optional revision at which to check")
77-
_ = checkCmd.Flags().MarkHidden("revision")
7868
checkCmd.Flags().Bool("explain", false, "requests debug information from SpiceDB and prints out a trace of the requests")
7969
checkCmd.Flags().Bool("schema", false, "requests debug information from SpiceDB and prints out the schema used")
8070
checkCmd.Flags().Bool("error-on-no-permission", false, "if true, zed will return exit code 1 if subject does not have unconditional permission")
8171
checkCmd.Flags().String("caveat-context", "", "the caveat context to send along with the check, in JSON form")
8272
registerConsistencyFlags(checkCmd.Flags())
8373

8474
permissionCmd.AddCommand(checkBulkCmd)
85-
checkBulkCmd.Flags().String("revision", "", "optional revision at which to check")
8675
checkBulkCmd.Flags().Bool("json", false, "output as JSON")
8776
checkBulkCmd.Flags().Bool("explain", false, "requests debug information from SpiceDB and prints out a trace of the requests")
8877
checkBulkCmd.Flags().Bool("schema", false, "requests debug information from SpiceDB and prints out the schema used")
8978
registerConsistencyFlags(checkBulkCmd.Flags())
9079

9180
permissionCmd.AddCommand(expandCmd)
9281
expandCmd.Flags().Bool("json", false, "output as JSON")
93-
expandCmd.Flags().String("revision", "", "optional revision at which to check")
9482
registerConsistencyFlags(expandCmd.Flags())
9583

96-
// NOTE: `lookup` is an alias of `lookup-resources` (below)
97-
// and must have the same list of flags in order for it to work.
98-
permissionCmd.AddCommand(lookupCmd)
99-
lookupCmd.Flags().Bool("json", false, "output as JSON")
100-
lookupCmd.Flags().String("revision", "", "optional revision at which to check")
101-
lookupCmd.Flags().String("caveat-context", "", "the caveat context to send along with the lookup, in JSON form")
102-
lookupCmd.Flags().Uint32("page-limit", 0, "limit of relations returned per page")
103-
registerConsistencyFlags(lookupCmd.Flags())
104-
10584
permissionCmd.AddCommand(lookupResourcesCmd)
10685
lookupResourcesCmd.Flags().Bool("json", false, "output as JSON")
107-
lookupResourcesCmd.Flags().String("revision", "", "optional revision at which to check")
10886
lookupResourcesCmd.Flags().String("caveat-context", "", "the caveat context to send along with the lookup, in JSON form")
10987
lookupResourcesCmd.Flags().Uint32("page-limit", 0, "limit of relations returned per page")
11088
lookupResourcesCmd.Flags().String("cursor", "", "resume pagination from a specific cursor token")
@@ -113,7 +91,6 @@ func RegisterPermissionCmd(rootCmd *cobra.Command) *cobra.Command {
11391

11492
permissionCmd.AddCommand(lookupSubjectsCmd)
11593
lookupSubjectsCmd.Flags().Bool("json", false, "output as JSON")
116-
lookupSubjectsCmd.Flags().String("revision", "", "optional revision at which to check")
11794
lookupSubjectsCmd.Flags().String("caveat-context", "", "the caveat context to send along with the lookup, in JSON form")
11895
registerConsistencyFlags(lookupSubjectsCmd.Flags())
11996

@@ -157,16 +134,6 @@ var lookupResourcesCmd = &cobra.Command{
157134
RunE: lookupResourcesCmdFunc,
158135
}
159136

160-
var lookupCmd = &cobra.Command{
161-
Use: "lookup <type> <permission> <subject:id>",
162-
Short: "Enumerates the resources of a given type for which the subject has permission",
163-
Args: ValidationWrapper(cobra.ExactArgs(3)),
164-
ValidArgsFunction: GetArgs(ResourceType, Permission, SubjectID),
165-
RunE: lookupResourcesCmdFunc,
166-
Deprecated: "prefer lookup-resources",
167-
Hidden: true,
168-
}
169-
170137
var lookupSubjectsCmd = &cobra.Command{
171138
Use: "lookup-subjects <resource:id> <permission> <subject_type#optional_subject_relation>",
172139
Short: "Enumerates the subjects of a given type for which the subject has permission on the resource",

internal/commands/relationship.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ func RegisterRelationshipCmd(rootCmd *cobra.Command) *cobra.Command {
5757
bulkDeleteCmd.Flags().Bool("force", false, "force deletion of all elements in batches defined by <optional-limit>")
5858
bulkDeleteCmd.Flags().String("subject-filter", "", "optional subject filter")
5959
bulkDeleteCmd.Flags().Uint32("optional-limit", 1000, "the max amount of elements to delete. If you want to delete all in batches of size <optional-limit>, set --force to true")
60-
bulkDeleteCmd.Flags().Bool("estimate-count", true, "estimate the count of relationships to be deleted")
61-
_ = bulkDeleteCmd.Flags().MarkDeprecated("estimate-count", "no longer used, make use of --optional-limit instead")
6260
return relationshipCmd
6361
}
6462

internal/commands/watch.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,6 @@ var (
2727
watchRelationshipFilters []string
2828
)
2929

30-
func RegisterWatchCmd(rootCmd *cobra.Command) *cobra.Command {
31-
rootCmd.AddCommand(watchCmd)
32-
33-
watchCmd.Flags().StringSliceVar(&watchObjectTypes, "object_types", nil, "optional object types to watch updates for")
34-
watchCmd.Flags().StringVar(&watchRevision, "revision", "", "optional revision at which to start watching")
35-
watchCmd.Flags().BoolVar(&watchTimestamps, "timestamp", false, "shows timestamp of incoming update events")
36-
return watchCmd
37-
}
38-
3930
func RegisterWatchRelationshipCmd(parentCmd *cobra.Command) *cobra.Command {
4031
parentCmd.AddCommand(watchRelationshipsCmd)
4132
watchRelationshipsCmd.Flags().StringSliceVar(&watchObjectTypes, "object_types", nil, "optional object types to watch updates for")
@@ -45,14 +36,6 @@ func RegisterWatchRelationshipCmd(parentCmd *cobra.Command) *cobra.Command {
4536
return watchRelationshipsCmd
4637
}
4738

48-
var watchCmd = &cobra.Command{
49-
Use: "watch [object_types, ...] [start_cursor]",
50-
Short: "Watches the stream of relationship updates and schema updates from the server",
51-
Args: ValidationWrapper(cobra.RangeArgs(0, 2)),
52-
RunE: watchCmdFunc,
53-
Deprecated: "please use `zed relationships watch` instead",
54-
}
55-
5639
var watchRelationshipsCmd = &cobra.Command{
5740
Use: "watch [object_types, ...] [start_cursor]",
5841
Short: "Watches the stream of relationship updates and schema updates from the server",

0 commit comments

Comments
 (0)