public void AddApiInfo(string api, string vcode) { ApiKeys.Add(new ApiInfo() { User = this, ApiKey = Convert.ToInt32(api), VerificationCode = vcode }); }
/// <summary> /// This will add a key to the system but WILL not update the config file. You must call the Save method manually. /// </summary> /// <param name="key">The key to add. If it is already present, this method will return.</param> public void AddKey(string key) { lock (ApiKeys) { if (!ApiKeys.Contains(key)) { ApiKeys.Add(key); } } }
public async Task <ExtendedApiKey> CreateNewApiKeyAsync(ExtendedUser user) { var newKey = new ExtendedApiKey { PublicKey = "somePublic", PrivateKey = "somePrivate" }; user.ApiKeys.Add(newKey); ApiKeys.Add(newKey); return(newKey); }
public HmacAuthenticationHandler(IOptionsMonitor <HmacAuthenticationOptions> optionsMonitor, ILoggerFactory logger, UrlEncoder urlEncoder, ISystemClock systemClock) : base(optionsMonitor, logger, urlEncoder, systemClock) { var localHostOnly = "127.0.0.1/32,::1/128"; var wideOpen = "0.0.0.0/0,::/0"; ApiKeys.Add("088546f2aba049d093234b07bf926ab1", new ApiKey() { AccessKey = "088546f2aba049d093234b07bf926ab1", EncryptedSecretKey = Encryption.Encrypt("pWN4NAwKk+SUokEvDNZ4fcX3t2ozTFPgypXKchk1ulM=", EncryptionKey.Value), CIDRs = localHostOnly }); }
void LoadApiKeys() { Log.Info("Load() apikeys"); DbCommand command = GetCommand(); command.CommandText = "SELECT * FROM ApiKey;"; var reader = command.ExecuteReader(); while (reader.Read()) { ApiKeys.Add(CreateApiKey(reader)); } }
private static void addApiParameters() { // OpenWeatherMap ApiKeys.Add(ApiEnum.OPENWEATHERMAP, "4ce3d25d1b8cb5953ba718abd11bd07a"); ApiUrls.Add(ApiEnum.OPENWEATHERMAP, "http://api.openweathermap.org/data/2.5"); // NewsAPI ApiKeys.Add(ApiEnum.NEWSAPI, "9d6d50c70043491ba1aa1a2048b4197a"); // Google Maps Geocoding ApiKeys.Add(ApiEnum.GOOGLEMAPSGEOCODING, "AIzaSyCUWewgFV1-ALfuAQpGC3S5uHlud1ucj20"); ApiUrls.Add(ApiEnum.GOOGLEMAPSGEOCODING, "https://maps.googleapis.com/maps/api/geocode/json?address="); }
public void AddApiKey(ApiKeySql apiKey) { ApiKeys.Add(apiKey); }