Move createOAuthHeadersProvider and createPrivateTokenHeadersProvider to gitlab-api-client-factory
Why
In [Refactor] Move GitLabClient factory to a reusa... (#345 - closed), gitlab-api-client-factory
package was added to encapsulate the AuthProvider
and GitLabClient
implementation logic.
Currently, there are some implementations of the above that live in gitlab-api-client
: createOAuthHeadersProvider
and createPrivateTokenHeadersProvider
. Moving them to gitlab-api-client-factory
is out of scope for the above refactor issue.
Context
The following discussion from !315 (merged) should be addressed:
-
@pslaughter started a discussion: (+3 comments) Why have a separate
-factory
package and not put this ingitlab-api-client
?I wanted
gitlab-api-client
to be very reusable and decoupled client for GitLab's API. It provides the interfaces it needs (likeAuthHeadersProvider
) but it doesn't know about the implementations.This package bridges the gap of providing implementations for
gitlab-api-client
, based on the givenconfig
. It has dependencies onweb-ide-types
andoauth-client
which would overload the responsibility ofgitlab-api-client
.WDYT? It's a cost to add extra packages like this, but I like keeping
gitlab-api-client
focused and decoupled from things likeAuthType
andOAuth
.
Acceptance Criteria
-
Move createOAuthHeadersProvider
andcreatePrivateTokenHeadersProvider
fromgitlab-api-client
togitlab-api-client-factory