* chore: remove workspace and bundled artifacts * chore: clean local-only repository artifacts * fix(pat): avoid shared command state in registration
40 lines
1.3 KiB
Go
40 lines
1.3 KiB
Go
// Copyright 2026 Alibaba Group
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
// Package pat implements the "dws pat" command group for PAT (Personal Action
|
|
// Token) authorization management.
|
|
package pat
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/DingTalk-Real-AI/dingtalk-workspace-cli/pkg/cmdutil"
|
|
"github.com/DingTalk-Real-AI/dingtalk-workspace-cli/pkg/edition"
|
|
)
|
|
|
|
// RegisterCommands adds the pat command tree to rootCmd.
|
|
func RegisterCommands(root *cobra.Command, c edition.ToolCaller) {
|
|
patCmd := &cobra.Command{
|
|
Use: "pat",
|
|
Short: "行为授权管理",
|
|
Long: `管理行为授权(PAT)。
|
|
|
|
命令结构:
|
|
dws pat chmod <scope>... 授予指定权限`,
|
|
RunE: cmdutil.GroupRunE,
|
|
}
|
|
|
|
patCmd.AddCommand(newChmodCommand(c))
|
|
root.AddCommand(patCmd)
|
|
}
|