MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / set_credentials_entry

Method set_credentials_entry

crates/chat-cli/src/database/mod.rs:244–253  ·  view source on GitHub ↗

Set cognito credentials used by toolkit telemetry.

(&mut self, credentials: &Credentials)

Source from the content-addressed store, hash-verified

242
243 /// Set cognito credentials used by toolkit telemetry.
244 pub fn set_credentials_entry(&mut self, credentials: &Credentials) -> Result<usize, DatabaseError> {
245 self.set_json_entry(Table::State, CREDENTIALS_KEY, CredentialsJson {
246 access_key_id: credentials.access_key_id.clone(),
247 secret_key: credentials.secret_key.clone(),
248 session_token: credentials.session_token.clone(),
249 expiration: credentials
250 .expiration
251 .and_then(|t| t.fmt(DateTimeFormat::DateTime).ok()),
252 })
253 }
254
255 /// Get the current user profile used to determine API endpoints.
256 pub fn get_auth_profile(&self) -> Result<Option<AuthProfile>, DatabaseError> {

Callers 1

Calls 3

set_json_entryMethod · 0.80
cloneMethod · 0.45
fmtMethod · 0.45

Tested by

no test coverage detected