all: Add untrusted folders behind feature flag (ref #62) (#7055)

This commit is contained in:
Simon Frei
2020-11-09 15:33:32 +01:00
committed by GitHub
parent 4db5ea5893
commit 31559e908b
59 changed files with 6952 additions and 1111 deletions
+19
View File
@@ -419,6 +419,9 @@ nextPendingDevice:
}
}
}
if cfg.Options.FeatureFlags == nil {
cfg.Options.FeatureFlags = []string{}
}
return nil
}
@@ -432,6 +435,22 @@ func (cfg *Configuration) DeviceMap() map[protocol.DeviceID]DeviceConfiguration
return m
}
// FolderPasswords returns the folder passwords set for this device, for
// folders that have an encryption password set.
func (cfg Configuration) FolderPasswords(device protocol.DeviceID) map[string]string {
res := make(map[string]string, len(cfg.Folders))
nextFolder:
for _, folder := range cfg.Folders {
for _, dev := range folder.Devices {
if dev.DeviceID == device && dev.EncryptionPassword != "" {
res[folder.ID] = dev.EncryptionPassword
continue nextFolder
}
}
}
return res
}
func ensureDevicePresent(devices []FolderDeviceConfiguration, myID protocol.DeviceID) []FolderDeviceConfiguration {
for _, device := range devices {
if device.DeviceID.Equals(myID) {