vscode-jenkins-pipeline-linter-connector icon indicating copy to clipboard operation
vscode-jenkins-pipeline-linter-connector copied to clipboard

Fix token auth (instead of setting headers)

Open ohartl opened this issue 4 years ago • 6 comments

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 avatar Apr 26 '21 16:04 ohartl

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

ohartl avatar Apr 26 '21 16:04 ohartl

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

jhd235 avatar Mar 16 '23 12:03 jhd235

@ohartl any news, please?

jhd235 avatar Mar 16 '23 13:03 jhd235

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.

bashbers avatar Jul 10 '23 12:07 bashbers

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

sbrahul avatar Sep 18 '23 14:09 sbrahul

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

dqwork avatar Oct 04 '23 12:10 dqwork

Well, maintainer is inactive, I cannot to anything

ohartl avatar Jun 12 '24 10:06 ohartl