jdalrymple / gitbeaker

🦊🧪 A comprehensive and typed Gitlab SDK for Node.js, Browsers, Deno and CLI
Other
1.5k stars 283 forks source link

PipelineTriggerTokens.trigger shouldn't require gitlab token input. #3597

Open Jianghong-bgcg opened 1 month ago

Jianghong-bgcg commented 1 month ago

Description

Don't know where to start, but my understanding is that the existence of pipeline trigger token is that, it creates a escape hatch that you can have another token that can only used for creating piplines, which is why in the api the trigger pipeline section specifically saying it doesn't need any other kind of token:

https://docs.gitlab.com/ee/api/pipeline_triggers.html

I believe today in order to initiate gitbeaker it needs to first new Gitlab with some kind of token, which kinda defeats the purpose of not needing such token.

Proposal create a escape hatch at new Gitlab({foo:bar}) such that it doesn't take any token input, maybe a boolean flag called noToken? I'm not sure how the code path down the road would work. it's fairly easy from api standpoint to toggle on/off of a token, but coding it into high level language makes such client object look really awkward.

Another way is to have a high level client obj similar to Gitlab but specifically for methods that don't require token? Checklist

jdalrymple commented 1 month ago

Good timing, haha, we just merged a PR that will allow once to initialise the wrapper without a token so you can do such calls, but i've been having trouble with out CI pipeline which has stopped the release of such a feature. Hopefully I cant get that sorted ASAP which should make this issue solved!