Skip to content

Commit

Permalink
Merge pull request #368 from saloonphp/feature/deprecate-auth-methods
Browse files Browse the repository at this point in the history
Feature | Deprecate Auth Methods
  • Loading branch information
Sammyjo20 authored Feb 10, 2024
2 parents 3c5cb10 + 7e285af commit fca735c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Traits/Auth/AuthenticatesRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function authenticate(Authenticator $authenticator): static
/**
* Authenticate the request with an Authorization header.
*
* @deprecated This method will be removed in Saloon v4. You should use the defaultAuth method or the `->authenticate(new TokenAuthenticator)` instead.
* @return $this
*/
public function withTokenAuth(string $token, string $prefix = 'Bearer'): static
Expand All @@ -60,6 +61,7 @@ public function withTokenAuth(string $token, string $prefix = 'Bearer'): static
/**
* Authenticate the request with "basic" authentication.
*
* @deprecated This method will be removed in Saloon v4. You should use the defaultAuth method or the `->authenticate(new BasicAuthenticator)` instead.
* @return $this
*/
public function withBasicAuth(string $username, string $password): static
Expand All @@ -70,6 +72,7 @@ public function withBasicAuth(string $username, string $password): static
/**
* Authenticate the request with "digest" authentication.
*
* @deprecated This method will be removed in Saloon v4. You should use the defaultAuth method or the `->authenticate(new DigestAuthenticator)` instead.
* @return $this
*/
public function withDigestAuth(string $username, string $password, string $digest): static
Expand All @@ -80,6 +83,7 @@ public function withDigestAuth(string $username, string $password, string $diges
/**
* Authenticate the request with a query parameter token.
*
* @deprecated This method will be removed in Saloon v4. You should use the defaultAuth method or the `->authenticate(new QueryAuthenticator)` instead.
* @return $this
*/
public function withQueryAuth(string $parameter, string $value): static
Expand All @@ -90,6 +94,7 @@ public function withQueryAuth(string $parameter, string $value): static
/**
* Authenticate the request with a header.
*
* @deprecated This method will be removed in Saloon v4. You should use the defaultAuth method or the `->authenticate(new HeaderAuthenticator)` instead.
* @return $this
*/
public function withHeaderAuth(string $accessToken, string $headerName = 'Authorization'): static
Expand All @@ -100,6 +105,7 @@ public function withHeaderAuth(string $accessToken, string $headerName = 'Author
/**
* Authenticate the request with a certificate.
*
* @deprecated This method will be removed in Saloon v4. You should use the defaultAuth method or the `->authenticate(new CertificateAuthenticator)` instead.
* @return $this
*/
public function withCertificateAuth(string $path, ?string $password = null): static
Expand Down
1 change: 0 additions & 1 deletion tests/Fixtures/Plugins/AuthenticatorPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

trait AuthenticatorPlugin
{

public function bootAuthenticatorPlugin(PendingRequest $pendingRequest): void
{
$pendingRequest->withTokenAuth('plugin-auth');
Expand Down

0 comments on commit fca735c

Please sign in to comment.