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

Token-based authentication is broken #19

Open
mpern opened this issue Dec 8, 2019 · 4 comments
Open

Token-based authentication is broken #19

mpern opened this issue Dec 8, 2019 · 4 comments

Comments

@mpern
Copy link

mpern commented Dec 8, 2019

VS Code 1.40.2
Jenkins Pipeline Linter Connector 1.2.0

After a quick look into the source, this line seems to be the issue:
https://github.com/janjoerke/vscode-jenkins-pipeline-linter-connector/blob/master/src/extension.ts#L63

The variable options doesn't have a property headers...

notificationsAlerts.ts:38 TypeError: Cannot convert undefined or null to object
	at Function.assign (<anonymous>)
	at requestCrumb (/home/user/.vscode/extensions/janjoerke.jenkins-pipeline-linter-connector-1.2.0/out/extension.js:65)
	at /home/user/.vscode/extensions/janjoerke.jenkins-pipeline-linter-connector-1.2.0/out/extension.js:36
	at Generator.next (<anonymous>)
	at /home/user/.vscode/extensions/janjoerke.jenkins-pipeline-linter-connector-1.2.0/out/extension.js:7
	at new Promise (<anonymous>)
	at __awaiter (/home/user/.vscode/extensions/janjoerke.jenkins-pipeline-linter-connector-1.2.0/out/extension.js:3)
	at /home/user/.vscode/extensions/janjoerke.jenkins-pipeline-linter-connector-1.2.0/out/extension.js:17
	at v._executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:527)
	at v.$executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:528)
	at f._doInvokeHandler (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:646)
	at f._invokeHandler (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:645)
	at f._receiveRequest (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:644)
	at f._receiveOneMessage (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:643)
	at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:641
	at l.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:47)
	at _.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:187)
	at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:798
	at l.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:47)
	at _.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:187)
	at t.PersistentProtocol._receiveMessage (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:191)
	at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:188
	at l.fire (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:47)
	at f.acceptChunk (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:184)
	at /usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:184
	at Socket.t (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:193)
	at Socket.emit (events.js:200)
	at addChunk (_stream_readable.js:294)
	at readableAddChunk (_stream_readable.js:275)
	at Socket.Readable.push (_stream_readable.js:210)
	at Pipe.onStreamRead (internal/stream_base_commons.js:166)
@pletnes
Copy link

pletnes commented Feb 4, 2020

I think I've encountered the same issue. I notice that if I leave out my password and try using the token based auth, I get this VS Code error message:

Cannot convert undefined or null to object

I figured it was an empty setting and, it seems, it is. So somehow the code is trying to access the password field, and it's empty, so it's "undefined or null", but should be a string.

@atiniir
Copy link

atiniir commented Mar 9, 2020

I've found if i put my token in for the password it works. i tried this after noticing a lot of plugins mention using tokens in their password fields, or call the field password_or_token

though this is pretty confusing. i think the token param should be removed and the docs updated to say to put the token in the password field

@mbedded
Copy link

mbedded commented Dec 6, 2020

Interesting point.. I took a look into my configuration (using token) and i have written my token value into jenkins.pipeline.linter.connector.pass (Settings as JSON).
Maybe there is a typo in the code so "password" and "token" are exchanged?

@ohartl
Copy link

ohartl commented Apr 26, 2021

Would be fixed by #31

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 a pull request may close this issue.

5 participants