Tags: brayniac/client-sdk-rust
Tags
feat: Add CredentialProvider & support v1 tokens (momentohq#146) Add the `CredentialProvider` construct that we have in other SDKs to parse auth tokens and get cache and control endpoints. This replaces the `EndpointResolver` and `jwt` modules. Credential Providers can either be created from a string or an environment variable. They can optionally override the cache and control endpoints (or just one or the other). ```rust let credential_provider = CredentialProviderBuilder::new_from_environment_variable("TEST_AUTH_TOKEN") .build() .expect("TEST_AUTH_TOKEN must be set"); ``` ```rust let credential_provider = CredentialProviderBuilder::new_from_string("my_test_token") .with_cache_endpoint("cache.localhost") .with_control_endpoint("control.localhost") .build() .expect("could not parse token and endpoints") ``` then ```rust let mut momento = SimpleCacheClientBuilder::new(credential_provider, Duration::from_secs(30))?.build(); ``` Co-authored-by: Kenny <[email protected]>
feat: remove redundant nested momento module (momentohq#93) Before this commit, the auth module was in a nested momento module. So, to access it, you would need to look in `momento::momento::auth`. This is, frankly, weird and unnecessary. This commit removes the nested momento module and drops the auth module into the crate root.
chore: makes clippy check consistent for unwrap warning (momentohq#73) Co-authored-by: Tyler Burdsall <[email protected]>
PreviousNext