Skip to content

Commit

Permalink
chore: find and replace all instances of MOMENTO_AUTH_TOKEN with MOME…
Browse files Browse the repository at this point in the history
…NTO_API_KEY (#354)
  • Loading branch information
anitarua authored Sep 12, 2023
1 parent 05e3e2e commit b8968cd
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import (
func main() {
context := context.Background()
configuration := config.LaptopLatestWithLogger(logger.NewNoopMomentoLoggerFactory()).WithClientTimeout(15 * time.Second)
credentialProvider, err := auth.NewEnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN")
credentialProvider, err := auth.NewEnvMomentoTokenProvider("MOMENTO_API_KEY")
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

Each example is a main.go file in its own directory.

To run an example, provide your Momento Auth Token as the MOMENTO_AUTH_TOKEN environment variable and `go run` the example's main.go. For example, to run the get/set/delete example...
To run an example, provide your Momento Auth Token as the MOMENTO_API_KEY environment variable and `go run` the example's main.go. For example, to run the get/set/delete example...

```
MOMENTO_AUTH_TOKEN=<YOUR_TOKEN> go run scalar-example/main.go
MOMENTO_API_KEY=<YOUR_TOKEN> go run scalar-example/main.go
```

## Using SDK in your project
Expand Down
2 changes: 1 addition & 1 deletion examples/aws-lambda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ You will also need a superuser token generated from the [Momento Console](https:
Then run:

```
npm run cdk -- deploy --parameters MomentoAuthToken=<YOUR_MOMENTO_AUTH_TOKEN>
npm run cdk -- deploy --parameters MomentoAuthToken=<YOUR_MOMENTO_API_KEY>
```

The lambda does not set up a way to access itself externally, so to run it, you will have to go to MomentoSimpleGet in AWS Lambda and run a test.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class MomentoLambdaStack extends cdk.Stack {
timeout: cdk.Duration.seconds(30),
memorySize: 128,
environment: {
MOMENTO_AUTH_TOKEN_SECRET_NAME: authTokenSecret.secretName,
MOMENTO_API_KEY_SECRET_NAME: authTokenSecret.secretName,
},
});

Expand Down
2 changes: 1 addition & 1 deletion examples/aws-lambda/lambda/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func getSecret(secretName string) (string, error) {
}

func getCacheClient() (momento.CacheClient, error) {
authToken, secretErr := getSecret("MOMENTO_AUTH_TOKEN_SECRET_NAME")
authToken, secretErr := getSecret("MOMENTO_API_KEY_SECRET_NAME")
if secretErr != nil {
panic(secretErr)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/dictionary-example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var (

func setup() {
ctx = context.Background()
var credentialProvider, err = auth.NewEnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN")
var credentialProvider, err = auth.NewEnvMomentoTokenProvider("MOMENTO_API_KEY")
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions examples/doc-examples-go-apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var (

func example_API_InstantiateCacheClient() {
context := context.Background()
credentialProvider, err := auth.NewEnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN")
credentialProvider, err := auth.NewEnvMomentoTokenProvider("MOMENTO_API_KEY")
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -114,7 +114,7 @@ func example_API_Delete() {
}

func example_API_InstantiateTopicClient() {
credProvider, err := auth.NewEnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN")
credProvider, err := auth.NewEnvMomentoTokenProvider("MOMENTO_API_KEY")
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/list-example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func removeValue(value momento.Value) {

func main() {
ctx = context.Background()
var credentialProvider, err = auth.NewEnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN")
var credentialProvider, err = auth.NewEnvMomentoTokenProvider("MOMENTO_API_KEY")
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/loadgen-topics/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func newLoadGenerator(config config.TopicsConfiguration, options topicsLoadGener

func (r *loadGenerator) init(ctx context.Context) (momento.TopicClient, momento.CacheClient) {
CacheName := r.options.cacheName
credentialProvider, err := auth.FromEnvironmentVariable("MOMENTO_AUTH_TOKEN")
credentialProvider, err := auth.FromEnvironmentVariable("MOMENTO_API_KEY")
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/loadgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func newLoadGenerator(config config.Configuration, options loadGeneratorOptions)
}

func (r *loadGenerator) init(ctx context.Context) (momento.CacheClient, time.Duration) {
credentialProvider, err := auth.FromEnvironmentVariable("MOMENTO_AUTH_TOKEN")
credentialProvider, err := auth.FromEnvironmentVariable("MOMENTO_API_KEY")
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/logging-example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ choice, so that Momento's logs will be written to the same destinations as the r
application's logs.`)
fmt.Println("")

creds, err := auth.FromEnvironmentVariable("MOMENTO_AUTH_TOKEN")
creds, err := auth.FromEnvironmentVariable("MOMENTO_API_KEY")
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions examples/pubsub-example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func pollForMessages(ctx context.Context, sub momento.TopicSubscription) {
}

func getTopicClient() momento.TopicClient {
credProvider, err := auth.NewEnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN")
credProvider, err := auth.NewEnvMomentoTokenProvider("MOMENTO_API_KEY")
if err != nil {
panic(err)
}
Expand All @@ -72,7 +72,7 @@ func getTopicClient() momento.TopicClient {
}

func getCacheClient() momento.CacheClient {
credProvider, err := auth.NewEnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN")
credProvider, err := auth.NewEnvMomentoTokenProvider("MOMENTO_API_KEY")
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/readme.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
func main() {
context := context.Background()
configuration := config.LaptopLatestWithLogger(logger.NewNoopMomentoLoggerFactory()).WithClientTimeout(15 * time.Second)
credentialProvider, err := auth.NewEnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN")
credentialProvider, err := auth.NewEnvMomentoTokenProvider("MOMENTO_API_KEY")
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/scalar-example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

func main() {
ctx := context.Background()
var credentialProvider, err = auth.NewEnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN")
var credentialProvider, err = auth.NewEnvMomentoTokenProvider("MOMENTO_API_KEY")
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/set-example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var (

func setup() {
ctx = context.Background()
var credentialProvider, err = auth.NewEnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN")
var credentialProvider, err = auth.NewEnvMomentoTokenProvider("MOMENTO_API_KEY")
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/sortedset-example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func main() {
}

func getClient() momento.CacheClient {
credProvider, err := auth.NewEnvMomentoTokenProvider("MOMENTO_AUTH_TOKEN")
credProvider, err := auth.NewEnvMomentoTokenProvider("MOMENTO_API_KEY")
if err != nil {
panic(err)
}
Expand Down

0 comments on commit b8968cd

Please sign in to comment.