Documentation
¶
Index ¶
- type ChangeNotifier
- type PermissionSet
- type Repository
- type Server
- func (s *Server) GetPermissions(ctx context.Context, req *connect.Request[taskguildv1.GetPermissionsRequest]) (*connect.Response[taskguildv1.GetPermissionsResponse], error)
- func (s *Server) SyncPermissionsFromDir(ctx context.Context, ...) (*connect.Response[taskguildv1.SyncPermissionsFromDirResponse], error)
- func (s *Server) UpdatePermissions(ctx context.Context, ...) (*connect.Response[taskguildv1.UpdatePermissionsResponse], error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangeNotifier ¶
type ChangeNotifier interface {
NotifyPermissionChange(projectID string)
}
ChangeNotifier is called after permission updates from the UI to push a SyncPermissionsCommand to connected Agent Managers.
type PermissionSet ¶
type PermissionSet struct {
ProjectID string `yaml:"project_id"`
Allow []string `yaml:"allow"`
Ask []string `yaml:"ask"`
Deny []string `yaml:"deny"`
UpdatedAt time.Time `yaml:"updated_at"`
}
PermissionSet represents project-scoped permission rules for Claude Code tools and Bash command patterns. One PermissionSet per project.
func Merge ¶
func Merge(stored *PermissionSet, localAllow, localAsk, localDeny []string) *PermissionSet
Merge performs a union merge of local permissions into stored permissions. Each category (allow, ask, deny) is independently merged with deduplication.
type Repository ¶
type Repository interface {
// Get returns the permission set for a project.
// Returns an empty PermissionSet (not an error) if none exists yet.
Get(ctx context.Context, projectID string) (*PermissionSet, error)
// Upsert creates or replaces the permission set for a project.
Upsert(ctx context.Context, ps *PermissionSet) error
}
Repository provides persistence for project-scoped permission sets.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements the PermissionService RPC handlers.
func NewServer ¶
func NewServer(repo Repository, notifier ChangeNotifier) *Server
NewServer creates a new permission service server.
func (*Server) GetPermissions ¶
func (s *Server) GetPermissions(ctx context.Context, req *connect.Request[taskguildv1.GetPermissionsRequest]) (*connect.Response[taskguildv1.GetPermissionsResponse], error)
GetPermissions returns the permission set for a project.
func (*Server) SyncPermissionsFromDir ¶
func (s *Server) SyncPermissionsFromDir(ctx context.Context, req *connect.Request[taskguildv1.SyncPermissionsFromDirRequest]) (*connect.Response[taskguildv1.SyncPermissionsFromDirResponse], error)
SyncPermissionsFromDir reads .claude/settings.json from the given directory and merges its permission rules into the stored set using union strategy.
func (*Server) UpdatePermissions ¶
func (s *Server) UpdatePermissions(ctx context.Context, req *connect.Request[taskguildv1.UpdatePermissionsRequest]) (*connect.Response[taskguildv1.UpdatePermissionsResponse], error)
UpdatePermissions replaces the full permission set for a project.