-
-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forge uses APIHOST including full url for auth-source-search bugging passwords-store #720
Comments
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. |
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. |
Thaodan
added a commit
to Thaodan/ghub
that referenced
this issue
Nov 3, 2024
Signed-off-by: Björn Bidar <[email protected]>
Thaodan
added a commit
to Thaodan/emacs.d
that referenced
this issue
Nov 3, 2024
Signed-off-by: Björn Bidar <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Preconditions
auth-source-pass-extra-query-keywords
set tot
[email protected]
for other hosts to not break retrieving secrets for userfoo
on
bar.host
.password-store
insideauth-sources
.Environment
Same for All dependencies
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
The text was updated successfully, but these errors were encountered: