Skip to content
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

Fix token auth (instead of setting headers) #31

Closed
wants to merge 1 commit into from

Conversation

ohartl
Copy link

@ohartl ohartl commented Apr 26, 2021

Fixes #19, #27 and #30. Also makes #15 obsolete.

I noticed that token auth wasn't working and having my password in plain text isn't an option.

Seems like Object.assign throws the error Cannot convert undefined or null to object because options.headers wasn't defined before. But i decided, instead of setting the headers to empty object above (like #15 does), using the options.auth to keep it consistent.
The code for token auth previously must have been missed that part when updating to options.auth.

The failure grabbed from VSCode Extension Host Logs was

[2021-04-26 17:54:48.096] [exthost] [error] TypeError: Cannot convert undefined or null to object
	at Function.assign (<anonymous>)
	at requestCrumb (c:\Users\<user>\.vscode\extensions\janjoerke.jenkins-pipeline-linter-connector-1.2.0\out\extension.js:65:38)
	at c:\Users\<user>\.vscode\extensions\janjoerke.jenkins-pipeline-linter-connector-1.2.0\out\extension.js:36:17
	at Generator.next (<anonymous>)
	at c:\Users\<user>\.vscode\extensions\janjoerke.jenkins-pipeline-linter-connector-1.2.0\out\extension.js:7:71
	at new Promise (<anonymous>)
	at __awaiter (c:\Users\<user>\.vscode\extensions\janjoerke.jenkins-pipeline-linter-connector-1.2.0\out\extension.js:3:12)
	at c:\Users\<user>\.vscode\extensions\janjoerke.jenkins-pipeline-linter-connector-1.2.0\out\extension.js:17:104
	... (truncated here)
	at Socket.emit (events.js:315:20)
	at addChunk (_stream_readable.js:295:12)
	at readableAddChunk (_stream_readable.js:271:9)
	at Socket.Readable.push (_stream_readable.js:212:10)
	at Pipe.onStreamRead (internal/stream_base_commons.js:186:23) jenkins.pipeline.linter.connector.validate

@ohartl
Copy link
Author

ohartl commented Apr 26, 2021

@janjoerke Ping back, this is important to make the plugin work for Jenkins API Token auth again.

@jhd235
Copy link

jhd235 commented Mar 16, 2023

@ohartl @janjoerke Hi, I'm having this issue. Maybe you have news on resolving this? thanks, regards

@jhd235
Copy link

jhd235 commented Mar 16, 2023

@ohartl any news, please?

@bashbers
Copy link

I'd like to see this merged as well. It's not intuitive to paste the token code in the password field when there is a designated token setting field.

@sbrahul
Copy link

sbrahul commented Sep 18, 2023

Is there a way to get the plugin with the fix? Anyway to compile locally and install it with the fix?

@dqwork
Copy link

dqwork commented Oct 4, 2023

Would love to see this merged - I've manually made this change on my local install and it fixes this problem

@ohartl
Copy link
Author

ohartl commented Jun 12, 2024

Well, maintainer is inactive, I cannot to anything

@ohartl ohartl closed this Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Token-based authentication is broken
5 participants