-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
Support native authentication #1106
Conversation
d942a56
to
b3ecb93
Compare
Once this is rebased and the TODO's you have above are taken care of, we can merge it! |
Hey @jdalrymple - I see you've pushed some commits, right? As for As for As for |
53bdc4e
to
9dc4854
Compare
haha, yea sorry. Ill go through it all this weekend, should get this one merged easily. Your recent change for the body should* work. Ill have to run a few tests to make sure though |
Sure fam, and no problem - we're all bussy:D thanks for your time! |
Last thing that needs to get done:
|
headers['content-type'] = 'application/json'; | ||
} else { | ||
bod = body as FormData; | ||
bod = { ...body, ...additionalBody } as FormData; |
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.
Nevermind - this addition is bad and results in the following error (I was able to isolate it and can confirm that it's caused precisely by this; reverting to the previous version fixes the error).
TypeError: Failed to construct 'Request': Request with GET/HEAD method cannot have body.
at new Ky (content.js:489)
at ky (content.js:724)
at content.js:1611
at Generator.next (<anonymous>)
at content.js:1558
at new Promise (<anonymous>)
at ./gitbeaker/packages/gitbeaker-browser/src/KyRequester.ts.__awaiter (content.js:1554)
at handler (content.js:1603)
at Object.requester.<computed> [as get] (content.js:5376)
at content.js:2093
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.
Then well have to think of another way around this since sending FormData would break this feature.
could you elaborate a little? I'm a little lost, esp. since it's been a little while:D
I have no idea as to how I could reliably test this feature since it depends on an external source (gitlab) -- I could cover the functionality itself with some unit tests (to verify that given |
a8e3a16
to
f1f3c98
Compare
In the README.md file, there is a section that goes over the different configuration options when instantiating a Service. Its a table. It currently includes things like the different tokens you can use etc. You would just need to add the two new options to that table. As for the tests, unit tests are fine. The integration tests do run against a live gitlab server, so if you want to test the full system, you could try tackling that through an integration test. |
2011e61
to
4e94c8f
Compare
9d8b4a7
to
4de4c47
Compare
Fixes jdalrymple#1098 These are the issues I encountered - please help: - [ ] fix TODOs - [ ] lint & fix (for me, there were a lot of unrelated changes after running lint:fix, so I didn't.) - [ ] verify this works because I couldn't test it because of jdalrymple#1105 Signed-off-by: Kipras Melnikovas <[email protected]>
Signed-off-by: Kipras Melnikovas <[email protected]>
it's good that I'm able to test on other environments too (this was needed on self-hosted GitLab Community edition) Signed-off-by: Kipras Melnikovas <[email protected]>
Signed-off-by: Kipras Melnikovas <[email protected]>
This reverts commit 3a8c02b. Signed-off-by: Kipras Melnikovas <[email protected]>
4de4c47
to
c2b9b10
Compare
Signed-off-by: Kipras Melnikovas <[email protected]>
Signed-off-by: Kipras Melnikovas <[email protected]>
Signed-off-by: Kipras Melnikovas <[email protected]>
c2b9b10
to
87c11b9
Compare
Heyo @jdalrymple, been a bit. I've updated the README - added Everything else should be fine. I wasn't able to ERROR in /home/kipras/projects/refined-gitlab/gitbeaker/packages/gitbeaker-requester-utils/src/BaseService.ts
./gitbeaker/packages/gitbeaker-requester-utils/src/BaseService.ts
[tsl] ERROR in /home/kipras/projects/refined-gitlab/gitbeaker/packages/gitbeaker-requester-utils/src/BaseService.ts(114,34)
TS2345: Argument of type 'this' is not assignable to parameter of type 'DefaultServiceOptions'.
Type 'BaseService' is not assignable to type 'DefaultServiceOptions'.
Types of property 'additionalBody' are incompatible.
Type 'FormData | Record<string, unknown> | undefined' is not assignable to type 'Record<string, unknown> | FormData | undefined'.
Type 'FormData' is not assignable to type 'Record<string, unknown> | FormData | undefined'.
Type 'FormData' is not assignable to type 'Record<string, unknown>'.
Index signature is missing in type 'FormData'. not sure how to fix this. I think that the first time I added in Slapping in a As for the tests, I'd like to write an integration test, but I have no clue as to how I'd implement this workflow (the steps 1-2 and 5 especially, others seem fine)
I've also rebased this on master -- it's up to date atm. I'd like to ship this to finally get rid of maintaining my separate mini-fork 👀 What do you think? |
until jdalrymple#1106 Signed-off-by: Kipras Melnikovas <[email protected]>
Amazing! Nice update. Ill give the ts error a look over and see if i can make heads of it. For the test, hmm. Well 1. Is accomplished already in the current integration tests. The password is 'password' and username is 'root' For 2. You could use playwright to login with this info after ? the gitlab instance information (like its url) is also located in the GITLAB_URL env var (http://docker:8080) as seen in the gitlab-ci.yml file. For 5. You could probably also accomplish this with playwright. Not sure though! |
jdalrymple/gitbeaker#1106 Signed-off-by: Kipras Melnikovas <[email protected]>
@kiprasmel @jdalrymple How is it going with this one ? |
hey @toniopelo, sorry I am currently very busy with the mess that's happening with javascript's pipeline operators [1] and won't have time to work on it anytime soon. to give some guidepoints, for me, I have a custom fork of gitbeaker, and use it inside my browser extension [2] which uses nativeAuth and last time I checked it worked, but it's been a while. [1] pipeline operators mess: tc39/proposal-pipeline-operator#91 (comment) (& further discussion) |
Hi @kiprasmel, thanks for the quick response! Good luck with the proposal and have a nice one! |
Hi, this is great, thank you! gl and thanks, you too:) |
Closed in favour of #2077 |
jdalrymple/gitbeaker#1106 Signed-off-by: Kipras Melnikovas <[email protected]>
Fixes #1098