MCPcopy Create free account
hub / github.com/pydio/cells / SetVaultMasterKey

Function SetVaultMasterKey

common/runtime/runtime.go:200–225  ·  view source on GitHub ↗
(masterKey string)

Source from the content-addressed store, hash-verified

198}
199
200func SetVaultMasterKey(masterKey string) {
201 var u *url.URL
202 var e error
203 if r.IsSet(KeyVault) && r.GetString(KeyVault) != "" && r.GetString(KeyVault) != "detect" {
204 u, e = url.Parse(r.GetString(KeyVault))
205 } else {
206 u, e = url.Parse(ConfigURL())
207 if u.Scheme == "file" {
208 // Replace basename with pydio-vault.json
209 u.Path = path.Join(path.Dir(u.Path), DefaultVaultFileName)
210 }
211
212 }
213 if e != nil {
214 return
215 }
216
217 q := u.Query()
218 q.Set("namespace", "vault")
219 q.Set("masterKey", url.QueryEscape(masterKey))
220 u.RawQuery = q.Encode()
221
222 str, _ := url.PathUnescape(u.String())
223
224 r.SetDefault("computedVaultURL", str)
225}
226
227func VaultURL() string {
228 // return ConfigURL()

Callers 1

initKeyringMethod · 0.92

Calls 9

ConfigURLFunction · 0.85
IsSetMethod · 0.65
GetStringMethod · 0.65
ParseMethod · 0.65
SetMethod · 0.65
EncodeMethod · 0.65
StringMethod · 0.65
SetDefaultMethod · 0.65
JoinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…