Example #1
0
        public (ISecretBackend backend, string path) ResolveSecretMount(string mountAndPath)
        {
            if (string.IsNullOrEmpty(mountAndPath))
            {
                return(null, null);
            }

            string mount = mountAndPath;
            string path  = string.Empty;

            while (!_secretMounts.Exists(mount))
            {
                int lastSlash = mount.LastIndexOf('/');
                if (lastSlash <= 0)
                {
                    // No more splitting and no match
                    return(null, null);
                }

                path  = $"{mount.Substring(lastSlash + 1)}/{path}";
                mount = mount.Substring(0, lastSlash);
            }

            return(_secretMounts.Get(mount), path);
        }
Example #2
0
        public void AddSecretMount(string mount, ISecretBackend backend)
        {
            if (_secretReservedMounts.Exists(mount))
            {
                throw new InvalidOperationException("RESERVED");
            }

            throw new NotImplementedException();
        }
Example #3
0
        public void AddAuthMount(string mount, IAuthBackend backend)
        {
            if (_authReservedMounts.Exists(mount))
            {
                throw new InvalidOperationException("RESERVED");
            }

            throw new NotImplementedException();
        }