UI : vocabulaire unifié, comptes + mots de passe, choix par élément, clé AES auto
This commit is contained in:
1 parent
ee8343c69f
commit
2ca2f87307
19 files changed
+377
-143
No files matched your search
@@ -72,6 +72,36 @@ var KindDeps = map[model.Kind][]model.Kind{
|
||||
model.KindUser: {model.KindGroup},
|
||||
}
|
||||
|
||||
// KindBundles are kinds chosen as one item: the accounts of the pve realm go
|
||||
// with their passwords (the API holds the accounts, shadow.cfg the passwords).
|
||||
var KindBundles = [][]model.Kind{{model.KindUser, model.KindPassword}}
|
||||
|
||||
// Bundle adds to a list of kinds the other kinds of their bundles, in the
|
||||
// order of model.Kinds.
|
||||
func Bundle(kinds []model.Kind) []model.Kind {
|
||||
in := map[model.Kind]bool{}
|
||||
for _, k := range kinds {
|
||||
in[k] = true
|
||||
}
|
||||
for _, b := range KindBundles {
|
||||
for _, k := range b {
|
||||
if in[k] {
|
||||
for _, x := range b {
|
||||
in[x] = true
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
out := []model.Kind{}
|
||||
for _, k := range model.Kinds {
|
||||
if in[k] {
|
||||
out = append(out, k)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// Sensitive is implemented by adapters whose fields must never be shown nor
|
||||
// journaled (password hashes): they are replaced by Redact.
|
||||
type Sensitive interface {
|
||||
@@ -102,7 +132,7 @@ func Redact(v any) any {
|
||||
return v
|
||||
}
|
||||
sum := sha256.Sum256([]byte(s))
|
||||
return "<masqué " + hex.EncodeToString(sum[:3]) + ">"
|
||||
return "<hidden " + hex.EncodeToString(sum[:3]) + ">"
|
||||
}
|
||||
|
||||
// Parents returns the keys of the objects o needs on the target.
|
||||
|
||||
Reference in new issue
Block a user