Added ldap and pam authentication

This commit is contained in:
Martino Ferrari
2026-06-23 17:59:40 +02:00
parent ac24011487
commit 11120bedca
36 changed files with 1935 additions and 66 deletions
+4
View File
@@ -61,6 +61,8 @@ type ConfigSet struct {
Version int `json:"version"`
Tag string `json:"tag,omitempty"`
Owner string `json:"owner,omitempty"`
Scope string `json:"scope,omitempty"` // access.Scope* visibility token
Groups []string `json:"groups,omitempty"` // groups for ScopeGroup visibility
Parameters []Parameter `json:"parameters"`
}
@@ -75,6 +77,8 @@ type ConfigInstance struct {
Version int `json:"version"`
Tag string `json:"tag,omitempty"`
Owner string `json:"owner,omitempty"`
Scope string `json:"scope,omitempty"` // access.Scope* visibility token
Groups []string `json:"groups,omitempty"` // groups for ScopeGroup visibility
Values map[string]any `json:"values"`
}
+12 -4
View File
@@ -49,6 +49,11 @@ type Meta struct {
// rules without the flag. Lets the rule list show enabled/disabled status
// without a GET per rule.
Enabled *bool `json:"enabled,omitempty"`
// Owner/Scope/Groups carry the visibility metadata so list handlers can filter
// by the caller without a GET per object. Empty scope = global (legacy-safe).
Owner string `json:"owner,omitempty"`
Scope string `json:"scope,omitempty"`
Groups []string `json:"groups,omitempty"`
}
// VersionMeta describes a single persisted revision.
@@ -87,9 +92,12 @@ type header struct {
ID string `json:"id"`
Name string `json:"name"`
Version int `json:"version"`
Tag string `json:"tag"`
SetID string `json:"setId"`
Enabled *bool `json:"enabled"`
Tag string `json:"tag"`
SetID string `json:"setId"`
Enabled *bool `json:"enabled"`
Owner string `json:"owner"`
Scope string `json:"scope"`
Groups []string `json:"groups"`
}
func validateID(id string) error {
@@ -154,7 +162,7 @@ func (s *Store) List(k Kind) ([]Meta, error) {
if err != nil {
continue
}
out = append(out, Meta{ID: id, Name: h.Name, Version: h.Version, SetID: h.SetID, Enabled: h.Enabled})
out = append(out, Meta{ID: id, Name: h.Name, Version: h.Version, SetID: h.SetID, Enabled: h.Enabled, Owner: h.Owner, Scope: h.Scope, Groups: h.Groups})
}
return out, nil
}