- Implemented StreamInterface, UploadedFileInterface, and UriInterface as per PSR standards. - Added getallheaders function to retrieve HTTP headers in a compatible manner. - Included LICENSE files for ralouphie/getallheaders and symfony/deprecation-contracts. - Introduced function for triggering deprecation notices in Symfony.
48 lines
1.1 KiB
PHP
48 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* Interface ATFPP\AI_Translate\Services\Contracts\Authentication
|
|
*
|
|
* @since 0.1.0
|
|
* @package ai-services
|
|
*/
|
|
|
|
namespace ATFPP\AI_Translate\Services\Contracts;
|
|
|
|
use Felix_Arntz\ATFPP\WP_OOP_Plugin_Lib\HTTP\Contracts\Request;
|
|
|
|
/**
|
|
* Interface for a class representing authentication credentials of a certain kind for an API client.
|
|
*
|
|
* @since 0.1.0
|
|
*/
|
|
interface Authentication {
|
|
|
|
/**
|
|
* Authenticates the given request with the credentials.
|
|
*
|
|
* @since 0.1.0
|
|
*
|
|
* @param Request $request The request instance. Updated in place.
|
|
*/
|
|
public function authenticate( Request $request ): void;
|
|
|
|
/**
|
|
* Sets the header name to use to add the credentials to a request.
|
|
*
|
|
* @since 0.1.0
|
|
*
|
|
* @param string $header_name The header name.
|
|
*/
|
|
public function set_header_name( string $header_name ): void;
|
|
|
|
/**
|
|
* Returns the option definitions needed to store the credentials.
|
|
*
|
|
* @since 0.1.0
|
|
*
|
|
* @param string $service_slug The service slug.
|
|
* @return array<string, array<string, mixed>> The option definitions.
|
|
*/
|
|
public static function get_option_definitions( string $service_slug ): array;
|
|
}
|