MCPcopy Create free account
hub / github.com/belak/gitdir / ensureSampleUsers

Function ensureSampleUsers

config_ensure.go:60–81  ·  view source on GitHub ↗
(targetNode *yaml.Node)

Source from the content-addressed store, hash-verified

58}
59
60func ensureSampleUsers(targetNode *yaml.Node) bool {
61 _, modified := targetNode.EnsureKey(
62 "users",
63 yaml.NewMappingNode(),
64 &yaml.EnsureOptions{
65 Comment: `
66Users defines the users who have access to the service. They will need an
67SSH key or invite added to their user account before they can access the
68server.
69#
70Sample user (with all options set):
71#
72belak:
73 is_admin: true
74 disabled: false
75 keys:
76 - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDeQfBUWIqpGXS8xCOg/0RKVOGTnzpIdL7r9wK1/xA52 belak@tmp`,
77 },
78 )
79
80 return modified
81}
82
83func ensureSampleGroups(targetNode *yaml.Node) bool {
84 _, modified := targetNode.EnsureKey(

Callers 1

ensureSampleConfigYamlFunction · 0.85

Calls 2

NewMappingNodeFunction · 0.92
EnsureKeyMethod · 0.80

Tested by

no test coverage detected