private async Task LoadSecrets()
        {
            System.Console.WriteLine(nameof(LoadSecrets));
            System.Console.WriteLine($"BuildConfig using {CurrentContext}");
            var clientConfig = _config.CreateClientConfiguration(CurrentContext);

            System.Console.WriteLine("Create client...");
            var client = new Kubernetes(clientConfig);

            System.Console.WriteLine("Starting request...");
            var secrets = await client.ListSecretForAllNamespacesWithHttpMessagesAsync();

            System.Console.WriteLine("Request complete.");
            if (secrets.Response.IsSuccessStatusCode)
            {
                foreach (var secret in secrets.Body.Items)
                {
                    var svm = new SecretViewModel
                    {
                        Namespace = secret.Metadata.NamespaceProperty,
                        Name      = secret.Metadata.Name,
                    };
                    Secrets.Add(svm);
                }
            }
        }
示例#2
0
 public virtual void AddSecret(
     [NotNull] string value,
     DateTime?expiration = null,
     string type         = IdentityServerConstants.SecretTypes.SharedSecret,
     string description  = null)
 {
     Secrets.Add(new ApiSecret(Id, value, expiration, type, description));
 }
示例#3
0
 public void AddSecrets(ApiResourceSecret apiResourceSecret)
 {
     if (Secrets == null)
     {
         Secrets = new List <ApiResourceSecret>();
     }
     Secrets.Add(apiResourceSecret);
 }
示例#4
0
 public virtual void AddSecret(
     [NotNull] string value,
     DateTime?expiration,
     string type,
     string description)
 {
     Secrets.Add(new ApiSecretDto(Id, value, expiration, type, description));
 }
示例#5
0
		public bool NewSecret(Entity entity)
		{
			if(entity == null || !entity.IsSecret || !entity.HasTag(GameTag.CLASS))
				return false;
			if(entity.HasCardId)
				Exclude(entity.CardId, false);
			var secret = new Secret(entity);
			Secrets.Add(secret);
			OnNewSecret(secret);
			Refresh();
			Log.Info(entity.ToString());
			return true;
		}
示例#6
0
        public void NewSecretPlayed(HeroClass heroClass, int id, int turn, string knownCardId = null)
        {
            var helper = new SecretHelper(heroClass, id, turn);

            if (knownCardId != null)
            {
                foreach (var cardId in SecretHelper.GetSecretIds(heroClass))
                {
                    helper.PossibleSecrets[cardId] = cardId == knownCardId;
                }
            }
            Secrets.Add(helper);
            Logger.WriteLine("Added secret with id:" + id, "OpponentSecrets");
        }
        public void NewSecretPlayed(HeroClass heroClass, int id, int turn, string knownCardId = null)
        {
            var helper = new SecretHelper(heroClass, id, turn);

            if (knownCardId != null)
            {
                foreach (var cardId in SecretHelper.GetSecretIds(heroClass))
                {
                    helper.TrySetSecret(cardId, cardId == knownCardId);
                }
            }
            Secrets.Add(helper);
            Log.Info("Added secret with id:" + id);
        }
示例#8
0
 public bool NewSecret(Entity entity)
 {
     if (entity == null || !entity.IsSecret || !entity.HasTag(GameTag.CLASS))
     {
         return(false);
     }
     if (entity.HasCardId)
     {
         Exclude(entity.CardId, false);
     }
     Secrets.Add(new Secret(entity));
     OnSecretsChanged?.Invoke(GetSecretList());
     Log.Info(entity.ToString());
     return(true);
 }
示例#9
0
        public void AddSecret(UserOrNpcInfo target)
        {
            if (!target.IsNpc && Secrets.Any(u => u.UserId == ((UserInfo)target).User.Id))
            {
                return;
            }
            else if (Secrets.Any(u => u.Name == target.NickOrName))
            {
                return;
            }

            if (target.IsNpc)
            {
                Secrets.Add(new Secret(target.NickOrName));
            }
            else
            {
                Secrets.Add(new Secret(((UserInfo)target).User));
            }
        }
示例#10
0
 public void AddSharedSecret(string secret, DateTime?expirationDateTime)
 {
     Secrets.Add(new ClientSecret(ClientSecretTypes.SharedSecret, secret, expirationDateTime));
 }
示例#11
0
 public void AddPrizeSecret(string name)
 {
     Secrets.Add(new Secret(name));
 }
示例#12
0
 public void NewSecretPlayed(int id, bool stolen)
 {
     Secrets.Add(new SecretHelper(HeroClass, id, stolen));
     Logger.WriteLine("Added secret with id:" + id, "OpponentSecrets");
 }
示例#13
0
 public void AddSharedSecret(string secret)
 {
     Secrets.Add(new ClientSecret(ClientSecretTypes.SharedSecret, PasswordHelper.ComputeHash(secret)));
 }