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(GitLab Node): Update credential test endpoint #5166

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

svzi
Copy link
Contributor

@svzi svzi commented Jan 15, 2023

Github issue / Community forum post (link here to close automatically):
https://community.n8n.io/t/no-access-via-accesstoken-to-self-hosted-gitlab-ce-ee/21802

To sum it up:
The credentials check of the GitLab node is doing wrong, because it's checking the /users endpoint. But that endpoint is used for listing all users of an instance and requires the api scope. So if the token has no scope for api the credentials test will fail.

A better approach to checking the credentials, without needing any special scope for it, is the endpoint /personal_access_tokens/self (see https://docs.gitlab.com/ee/api/personal_access_tokens.html#using-a-request-header) which shows everything related to the currently used accessToken (e.g. the scopes and expiration date).

@n8n-assistant n8n-assistant bot added community Authored by a community member node/improvement New feature or request labels Jan 15, 2023
@Joffcom Joffcom changed the title fix(GitLab Node): Fixed credentials test fix(GitLab Node): Update credential test endpoint Jan 16, 2023
@Joffcom
Copy link
Member

Joffcom commented Jan 16, 2023

Hey @svzi,

Thanks for the PR, I have just given it a test and it works well. I will get this merged shortly.

@Joffcom Joffcom merged commit e275306 into n8n-io:master Jan 19, 2023
@Joffcom
Copy link
Member

Joffcom commented Jan 19, 2023

Hey @svzi,

Thanks for the PR, This has now been merged and will be part of the next release 🎉

@svzi svzi deleted the fixed-gitlabapi-credentials-test branch January 19, 2023 09:25
@svzi
Copy link
Contributor Author

svzi commented Jan 19, 2023

@Joffcom Thanks a lot! 🥳

@n8n-assistant n8n-assistant bot added the Upcoming Release Will be part of the upcoming release label Jan 19, 2023
MiloradFilipovic added a commit that referenced this pull request Jan 19, 2023
* master:
  docs: Update the contribution guidelines (no-changelog) (#5165)
  fix(HTTP Request Node): Bug - node requires string instead of json
  fix(GitLab Node): Update credential test endpoint (#5166)
  fix(editor): Allow special chars in node selector completion (#5196)
  test: Add tests for pinning data (#5157)
  fix(core): Fix migration (no-changelog) (#5186)
  fix(HTTP Request Node): Response format to text is ignored for JSON responses
  fix(Gmail Trigger Node): Filter by labels not working (#5173)
  feat(Item Lists Node): Table tranformation
  📚 Update CHANGELOG.md and main package.json to 0.211.2
  🔖 Release n8n@0.211.2
  ⬆️ Set n8n-nodes-base@0.209.2 on n8n
  🔖 Release n8n-nodes-base@0.209.2
  fix(core): Restore community nodes installation (#5180)
  feat: (Google Sheets Trigger Node): Trigger for Google Sheets
  test: Add e2e tests for PRs (#5176)
@janober
Copy link
Member

janober commented Jan 19, 2023

Got released with n8n@0.212.0

@janober janober removed the Upcoming Release Will be part of the upcoming release label Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Authored by a community member node/improvement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants