-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Working with two-way authentication in custom Gitlab server #895
base: main
Are you sure you want to change the base?
Conversation
Maybe there is better way to do it? |
li "^1.3.0" | ||
query-string "^6.8.1" | ||
randomstring "^1.1.5" | ||
universal-url "^2.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried that we have both gitlab 10, as we have gitlab locked to v6 in the app - have you tried updating gitlab to v10 and seeing if that can fix it in general?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first, I've tried to use just node script without dangerjs with last gitlab
as dependency.
This problem was reproduced.
Gitlab have an option to fix it - not very handy but working - send custom requester
as parameter.
I made the fix with extra options
actually, this function in my code fixes my problem:
function buildAgent() {
const { GITLAB_SSL_KEY, GITLAB_SSL_CERT } = process.env;
if (GITLAB_SSL_KEY || GITLAB_SSL_CERT) {
const key = readKey(GITLAB_SSL_KEY);
const cert = readKey(GITLAB_SSL_CERT);
return new https.Agent({
key,
cert,
})
}
return;
}
If it would be better for this PR, I can downgrade some dependencies in my project.
Or, maybe, would be better to extend Dangerjs API to allow sending extra platform-specific options (github, bitbucket etc.) in dangerfile
script? Like requester
in gitlab https://github.com/jdalrymple/node-gitlab
It would allows me do not fork danger-js only to use it in my case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth giving this another shot now that #903 is in
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
New dependencies added: |
I'm curious whats up with this PR, I'm having a similar issue it seems like with a gitlab self hosted instance that has two way auth. |
@ludakhris I cannot check if it does work now, since I don't have access to the GitLab instance for which I've created this PR anymore. But if you need this, you can build my fork of DangerJS. It depends on my custom custom-node-gitlab-requester, which also required building. |
Before this PR, DangerJS was supporting only NODE_EXTRA_CA_CERTS env-variable to set CA certificates.
In my case, I need to use also my SSL Key and my SSL Certificate to connect to Gitlab Api.
When reading node-gitlab docs https://github.com/jdalrymple/node-gitlab I've found only way to do this as using custom requester (requester prop in options)
So, I've made my own KyRequestor realization with supporting of GITLAB_SSL_KEY and GITLAB_SSL_CERT env-variables.