Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
2 parents ffac647 + 2836a65 commit 1c841db
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
env:
# TODO: remove token stored as secret in favor of using a
# momento-local instance that can be spun up for testing
MOMENTO_AUTH_TOKEN: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
MOMENTO_API_KEY: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}

steps:
- name: Setup repo
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ using Momento.Sdk.Auth;
using Momento.Sdk.Config;
using Momento.Sdk.Responses;

ICredentialProvider authProvider = new EnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN");
ICredentialProvider authProvider = new EnvMomentoTokenProvider("MOMENTO_API_KEY");
const string CACHE_NAME = "cache";
const string KEY = "MyKey";
const string VALUE = "MyData";
Expand Down
2 changes: 1 addition & 1 deletion examples/DictionaryExample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public class Driver
{
private static readonly string AUTH_TOKEN_ENV_VAR = "MOMENTO_AUTH_TOKEN";
private static readonly string AUTH_TOKEN_ENV_VAR = "MOMENTO_API_KEY";
private static readonly string CACHE_NAME_ENV_VAR = "MOMENTO_CACHE_NAME";
private static readonly ILogger _logger;
private static readonly ILoggerFactory _loggerFactory;
Expand Down
2 changes: 1 addition & 1 deletion examples/DisposableTokens/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static class Program

static Program()
{
authProvider = new EnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN");
authProvider = new EnvMomentoTokenProvider("MOMENTO_API_KEY");
client = new AuthClient(AuthConfigurations.Default.Latest(), authProvider);
}

Expand Down
4 changes: 2 additions & 2 deletions examples/DisposableTokens/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ This example program demonstrates how to generate disposable Momento auth tokens

# Usage

The program assumes that your Momento auth token is available in the `MOMENTO_AUTH_TOKEN` environment variable:
The program assumes that your Momento auth token is available in the `MOMENTO_API_KEY` environment variable:

```bash
MOMENTO_AUTH_TOKEN=<YOUR_AUTH_TOKEN> dotnet run
MOMENTO_API_KEY=<YOUR_AUTH_TOKEN> dotnet run
```

The example generates a disposable expiring auth token using the enumerated permissions and expiry defined in the program and prints its attributes to the console.
8 changes: 4 additions & 4 deletions examples/DocExampleApis/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ public static async Task Main(string[] args)
{
var config = Configurations.Laptop.V1();
var client = new CacheClient(config,
new EnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN"),
new EnvMomentoTokenProvider("MOMENTO_API_KEY"),
TimeSpan.FromSeconds(10));
IAuthClient authClient = new AuthClient(
AuthConfigurations.Default.Latest(),
new EnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN")
new EnvMomentoTokenProvider("MOMENTO_API_KEY")
);
ITopicClient topicClient = new TopicClient(
TopicConfigurations.Laptop.latest(),
new EnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN")
new EnvMomentoTokenProvider("MOMENTO_API_KEY")
);

await Example_API_CreateCache(client);
Expand Down Expand Up @@ -240,7 +240,7 @@ public static async Task Example_API_InstantiateTopicClient()
{
new TopicClient(
TopicConfigurations.Laptop.latest(),
new EnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN")
new EnvMomentoTokenProvider("MOMENTO_API_KEY")
);
}
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
Expand Down
4 changes: 2 additions & 2 deletions examples/MomentoApplication/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Momento.Sdk.Exceptions;
using Momento.Sdk.Responses;

ICredentialProvider authProvider = new EnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN");
ICredentialProvider authProvider = new EnvMomentoTokenProvider("MOMENTO_API_KEY");

TimeSpan DEFAULT_TTL = TimeSpan.FromSeconds(60);

Expand Down Expand Up @@ -128,7 +128,7 @@ public static async Task DeleteCacheExample(ICacheClient client) {
/// </summary>
public static void EagerConnectionExample()
{
ICredentialProvider authProvider = new EnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN");
ICredentialProvider authProvider = new EnvMomentoTokenProvider("MOMENTO_API_KEY");
TimeSpan defaultTtl = TimeSpan.FromSeconds(60);
var config = Configurations.Laptop.V1();
var eagerConnectionConfig = config.WithTransportStrategy(config.TransportStrategy.WithEagerConnectionTimeout(TimeSpan.FromSeconds(10)));
Expand Down
4 changes: 2 additions & 2 deletions examples/MomentoApplication/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ functionality, including:
Run the following from within the `examples` directory:

```bash
MOMENTO_AUTH_TOKEN=<YOUR AUTH TOKEN> dotnet run --project MomentoApplication
MOMENTO_API_KEY=<YOUR AUTH TOKEN> dotnet run --project MomentoApplication
```

Within the `MomentoAppication` directory you can run:

```bash
MOMENTO_AUTH_TOKEN=<YOUR AUTH TOKEN> dotnet run
MOMENTO_API_KEY=<YOUR AUTH TOKEN> dotnet run
```

## Error Handling
Expand Down
2 changes: 1 addition & 1 deletion examples/MomentoFSharpApplication/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ open System

let CACHE_NAME = "cache"
let DEFAULT_TTL = TimeSpan.FromSeconds(60.0)
let authProvider = new EnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN")
let authProvider = new EnvMomentoTokenProvider("MOMENTO_API_KEY")

let exerciseCache() = (
printfn "Howdy"
Expand Down
2 changes: 1 addition & 1 deletion examples/MomentoLoadGen/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public CsharpLoadGenerator(IConfiguration momentoClientConfig, CsharpLoadGenerat

public async Task Run()
{
var authProvider = new EnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN");
var authProvider = new EnvMomentoTokenProvider("MOMENTO_API_KEY");

using (ICacheClient momento = new CacheClient(
_momentoClientConfig,
Expand Down
6 changes: 3 additions & 3 deletions examples/MomentoLoadGen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ To run the load generator (from the `examples` directory):

```bash
# Run example load generator
MOMENTO_AUTH_TOKEN=<YOUR AUTH TOKEN> dotnet run --project MomentoLoadGen
MOMENTO_API_KEY=<YOUR AUTH TOKEN> dotnet run --project MomentoLoadGen
```

Within the `MomentoLoadGen` directory you can run:

```bash
# Run example load generator
MOMENTO_AUTH_TOKEN=<YOUR AUTH TOKEN> dotnet run
MOMENTO_API_KEY=<YOUR AUTH TOKEN> dotnet run
```

If you make modifications to the code, remember to do a clean otherwise
the program might not run.

```bash
dotnet clean
MOMENTO_AUTH_TOKEN=<YOUR AUTH TOKEN> dotnet run
MOMENTO_API_KEY=<YOUR AUTH TOKEN> dotnet run
```
2 changes: 1 addition & 1 deletion examples/MomentoUsage/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Momento.Sdk.Config;
using Momento.Sdk.Responses;

ICredentialProvider authProvider = new EnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN");
ICredentialProvider authProvider = new EnvMomentoTokenProvider("MOMENTO_API_KEY");
const string CACHE_NAME = "cache";
const string KEY = "MyKey";
const string VALUE = "MyData";
Expand Down
4 changes: 2 additions & 2 deletions examples/MomentoUsage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ the client's full capabilities, take a look at the more advanced [MomentoApplic
Run the following from within the `examples` directory:

```bash
MOMENTO_AUTH_TOKEN=<YOUR AUTH TOKEN> dotnet run --project MomentoUsage
MOMENTO_API_KEY=<YOUR AUTH TOKEN> dotnet run --project MomentoUsage
```

Within the `MomentoUsage` directory you can run:

```bash
MOMENTO_AUTH_TOKEN=<YOUR AUTH TOKEN> dotnet run
MOMENTO_API_KEY=<YOUR AUTH TOKEN> dotnet run
```

## Error Handling
Expand Down
2 changes: 1 addition & 1 deletion examples/TopicExample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace TopicExample;

public class Driver
{
private const string AuthTokenEnvVar = "MOMENTO_AUTH_TOKEN";
private const string AuthTokenEnvVar = "MOMENTO_API_KEY";
private const string CacheNameEnvVar = "MOMENTO_CACHE_NAME";
private const string TopicName = "example-topic";
private static readonly ILogger Logger;
Expand Down
4 changes: 2 additions & 2 deletions src/Momento.Sdk/Internal/DataGrpcManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,9 @@ internal DataGrpcManager(IConfiguration config, string authToken, string endpoin
pingClient.Ping(new _PingRequest(),
new CallOptions(deadline: DateTime.UtcNow.Add(eagerConnectionTimeout)));
}
catch (RpcException)
catch (RpcException ex)
{
_logger.LogWarning("Failed to eagerly connect to the server; continuing with execution in case failure is recoverable later.");
_logger.LogWarning($"Failed to eagerly connect to the server; continuing with execution in case failure is recoverable later: {ex}");
}
}

Expand Down

0 comments on commit 1c841db

Please sign in to comment.