Add hook for post AWS sign-in
This commit is contained in:
parent
4aca751165
commit
788ce9de6d
1 changed files with 8 additions and 1 deletions
|
|
@ -43,6 +43,9 @@
|
||||||
(defvar aws-reauth-timer nil
|
(defvar aws-reauth-timer nil
|
||||||
"The reauth timer, if created.")
|
"The reauth timer, if created.")
|
||||||
|
|
||||||
|
(defvar aws-post-signin-hook nil
|
||||||
|
"Hook to run after an AWS sign-in.")
|
||||||
|
|
||||||
(defun aws--login (role)
|
(defun aws--login (role)
|
||||||
"Internal login function --- handles the command as a process, and prompts for MFA."
|
"Internal login function --- handles the command as a process, and prompts for MFA."
|
||||||
(let* ((process-name (format "%s-%s" aws-cli-auth-provider (replace-regexp-in-string "[/:]" "-" role)))
|
(let* ((process-name (format "%s-%s" aws-cli-auth-provider (replace-regexp-in-string "[/:]" "-" role)))
|
||||||
|
|
@ -67,7 +70,11 @@
|
||||||
(when (string-match-p prompt-regexp buffer-contents)
|
(when (string-match-p prompt-regexp buffer-contents)
|
||||||
(setq prompt-sent t)
|
(setq prompt-sent t)
|
||||||
(let ((token (read-passwd "MFA token: ")))
|
(let ((token (read-passwd "MFA token: ")))
|
||||||
(process-send-string proc (concat token "\n")))))))))))
|
(process-send-string proc (concat token "\n"))))))))
|
||||||
|
:sentinel
|
||||||
|
(lambda (proc event)
|
||||||
|
(when (string= "finished\n" event)
|
||||||
|
(run-hooks 'aws-post-signin-hook))))))
|
||||||
|
|
||||||
(defun aws-sign-in ()
|
(defun aws-sign-in ()
|
||||||
"Sign in with AWS."
|
"Sign in with AWS."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue