-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(app sec): Add AppSecRequest class (#13)
- Loading branch information
1 parent
fe3afd8
commit 85f25f5
Showing
11 changed files
with
385 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace CrowdSec\Common\Client\HttpMessage; | ||
|
||
/** | ||
* Request that will be sent to CrowdSec AppSec component. | ||
* | ||
* @author CrowdSec team | ||
* | ||
* @see https://crowdsec.net CrowdSec Official Website | ||
* | ||
* @copyright Copyright (c) 2024+ CrowdSec | ||
* @license MIT License | ||
*/ | ||
class AppSecRequest extends Request | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
protected $headers = []; | ||
/** | ||
* @var string | ||
*/ | ||
private $rawBody = ''; | ||
|
||
public function __construct( | ||
string $uri, | ||
string $method, | ||
array $headers = [], | ||
string $rawBody = '', | ||
) { | ||
$this->rawBody = $rawBody; | ||
parent::__construct($uri, $method, $headers); | ||
} | ||
|
||
public function getRawBody(): string | ||
{ | ||
return $this->rawBody; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.