fix(drive): use docs secure label read scope (#1281)

This commit is contained in:
caojie0621
2026-06-05 12:48:22 +08:00
committed by GitHub
parent 2f4e2c3019
commit 62364fc320
2 changed files with 12 additions and 1 deletions

View File

@@ -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"
)

View File

@@ -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())