From 62364fc3202dee708d9818b8e9feef88d6d9e7df Mon Sep 17 00:00:00 2001 From: caojie0621 Date: Fri, 5 Jun 2026 12:48:22 +0800 Subject: [PATCH] fix(drive): use docs secure label read scope (#1281) --- shortcuts/drive/drive_secure_label.go | 2 +- shortcuts/drive/drive_secure_label_test.go | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/shortcuts/drive/drive_secure_label.go b/shortcuts/drive/drive_secure_label.go index a7b8f95db..8c99f3700 100644 --- a/shortcuts/drive/drive_secure_label.go +++ b/shortcuts/drive/drive_secure_label.go @@ -13,7 +13,7 @@ import ( ) const ( - secureLabelReadScope = "drive:file.meta.sec_label.read_only" + secureLabelReadScope = "docs:secure_label:readonly" secureLabelUpdateScope = "docs:secure_label:write_only" ) diff --git a/shortcuts/drive/drive_secure_label_test.go b/shortcuts/drive/drive_secure_label_test.go index 6132c4357..49edaa1b4 100644 --- a/shortcuts/drive/drive_secure_label_test.go +++ b/shortcuts/drive/drive_secure_label_test.go @@ -12,6 +12,17 @@ import ( "github.com/larksuite/cli/internal/httpmock" ) +func TestDriveSecureLabelScopes(t *testing.T) { + t.Parallel() + + if len(DriveSecureLabelList.Scopes) != 1 || DriveSecureLabelList.Scopes[0] != "docs:secure_label:readonly" { + t.Fatalf("list scopes = %v, want docs:secure_label:readonly", DriveSecureLabelList.Scopes) + } + if len(DriveSecureLabelUpdate.Scopes) != 1 || DriveSecureLabelUpdate.Scopes[0] != "docs:secure_label:write_only" { + t.Fatalf("update scopes = %v, want docs:secure_label:write_only", DriveSecureLabelUpdate.Scopes) + } +} + func TestDriveSecureLabelList_DryRun(t *testing.T) { t.Parallel() f, stdout, _, _ := cmdutil.TestFactory(t, driveTestConfig())