Open Thaodan opened 1 month ago
I am considering
@@ -764,9 +764,14 @@ (defun ghub--basic-auth (host username)
(defun ghub--token (host username package &optional nocreate forge)
(let* ((user (ghub--ident username package))
+ (host* (and (string-match "/" host)
+ (substring host 0 (match-beginning 0))))
(token
(or (car (ghub--auth-source-get (list :secret)
:host host :user user))
+ (and host*
+ (car (ghub--auth-source-get (list :secret)
+ :host host :user user)))
(progn
;; Auth-Source caches the information that there is no
;; value, but in our case that is a situation that needs
@@ -775,6 +780,8 @@ (defun ghub--token (host username package &optional nocreate forge)
;; The (:max 1) is needed and has to be placed at the
;; end for Emacs releases before 26.1. #24 #64 #72
(auth-source-forget (list :host host :user user :max 1))
+ (when host*
+ (auth-source-forget (list :host host* :user user :max 1)))
(and (not nocreate)
(error "\
Required %s token (\"%s\" for \"%s\") does not exist.
but to many suggestions are coming in right now and I won't be able to deal with this any time soon.
but to many suggestions are coming in right now and I won't be able to deal with this any time soon.
Take your time!
What I did to workaround/fix the issue was this:
diff --git a/lisp/ghub.el b/lisp/ghub.el
index 4451526..d98949d 100644
--- a/lisp/ghub.el
+++ b/lisp/ghub.el
@@ -775,7 +775,7 @@ and call `auth-source-forget+'."
(let* ((user (ghub--ident username package))
(token
(or (car (ghub--auth-source-get (list :secret)
- :host host :user user))
+ :host (url-host (url-generic-parse-url (concat "//" host))) :user user))
(progn
;; Auth-Source caches the information that there is no
;; value, but in our case that is a situation that needs
I was going to post this earlier but forgot.
Preconditions
auth-source-pass-extra-query-keywords
set tot
foo@bar.host
for other hosts to not break retrieving secrets for userfoo
onbar.host
.password-store
insideauth-sources
.Environment
Expected
Secret is found.
Observed
Forge uses the full url that includes not just the host for Gitlab based Forges. Forge should not use the full url to retrieve passwords I think.
Backtrace