Skip to content
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

Feature | Deprecate Auth Methods #368

Merged
merged 2 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading