File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class Factory
3636 /**
3737 * The bearer token used for authentication.
3838 */
39- protected string $ bearerToken ;
39+ protected string $ authToken ;
4040
4141 /**
4242 * The http client to use for the requests.
@@ -87,9 +87,9 @@ public function withTenant(string $tenant): self
8787 /**
8888 * The bearer token used to authenticate requests.
8989 */
90- public function withBearerToken (string $ bearerToken ): self
90+ public function withAuthToken (string $ authToken ): self
9191 {
92- $ this ->bearerToken = $ bearerToken ;
92+ $ this ->authToken = $ authToken ;
9393 return $ this ;
9494 }
9595
@@ -118,8 +118,8 @@ public function createApiClient() : ChromaApiClient
118118 'Accept ' => 'application/json ' ,
119119 ];
120120
121- if (!empty ($ this ->bearerToken )) {
122- $ headers ['Authorization ' ] = 'Bearer ' . $ this ->bearerToken ;
121+ if (!empty ($ this ->authToken )) {
122+ $ headers ['Authorization ' ] = 'Bearer ' . $ this ->authToken ;
123123 }
124124
125125 $ this ->httpClient ??= new \GuzzleHttp \Client ([
Original file line number Diff line number Diff line change 2424test ('can connect to an API token authenticated chroma server ' , function () {
2525 $ client = ChromaDB::factory ()
2626 ->withPort (8001 )
27- ->withBearerToken ('test-token ' )
27+ ->withAuthToken ('test-token ' )
2828 ->connect ();
2929
3030 expect ($ client )->toBeInstanceOf (Client::class);
3333it ('cannot connect to an API token authenticated chroma server with wrong token ' , function () {
3434 ChromaDB::factory ()
3535 ->withPort (8001 )
36- ->withBearerToken ('wrong-token ' )
36+ ->withAuthToken ('wrong-token ' )
3737 ->connect ();
3838})->throws (ChromaAuthorizationException::class);
3939
You can’t perform that action at this time.
0 commit comments