aboutsummaryrefslogtreecommitdiff
path: root/weed/credential/credential_store.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2025-07-12 01:13:11 -0700
committerGitHub <noreply@github.com>2025-07-12 01:13:11 -0700
commit687a6a6c1de0fb67b51ec9bfd1781a6c255ff695 (patch)
tree3ee2890c890e67a170cec2692425528aa9cd795f /weed/credential/credential_store.go
parent49d43003e1f5063c57cd1b122469c0cb68d0cd79 (diff)
downloadseaweedfs-687a6a6c1de0fb67b51ec9bfd1781a6c255ff695.tar.xz
seaweedfs-687a6a6c1de0fb67b51ec9bfd1781a6c255ff695.zip
Admin UI: Add policies (#6968)
* add policies to UI, accessing filer directly * view, edit policies * add back buttons for "users" page * remove unused * fix ui dark mode when modal is closed * bucket view details button * fix browser buttons * filer action button works * clean up masters page * fix volume servers action buttons * fix collections page action button * fix properties page * more obvious * fix directory creation file mode * Update file_browser_handlers.go * directory permission
Diffstat (limited to 'weed/credential/credential_store.go')
-rw-r--r--weed/credential/credential_store.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/weed/credential/credential_store.go b/weed/credential/credential_store.go
index cd36263dc..6fe5a5da1 100644
--- a/weed/credential/credential_store.go
+++ b/weed/credential/credential_store.go
@@ -86,5 +86,27 @@ type UserCredentials struct {
UpdatedAt time.Time `json:"updatedAt"`
}
+// PolicyStatement represents a single policy statement in an IAM policy
+type PolicyStatement struct {
+ Effect string `json:"Effect"`
+ Action []string `json:"Action"`
+ Resource []string `json:"Resource"`
+}
+
+// PolicyDocument represents an IAM policy document
+type PolicyDocument struct {
+ Version string `json:"Version"`
+ Statement []*PolicyStatement `json:"Statement"`
+}
+
+// PolicyManager interface for managing IAM policies
+type PolicyManager interface {
+ GetPolicies(ctx context.Context) (map[string]PolicyDocument, error)
+ CreatePolicy(ctx context.Context, name string, document PolicyDocument) error
+ UpdatePolicy(ctx context.Context, name string, document PolicyDocument) error
+ DeletePolicy(ctx context.Context, name string) error
+ GetPolicy(ctx context.Context, name string) (*PolicyDocument, error)
+}
+
// Stores holds all available credential store implementations
var Stores []CredentialStore