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

5.3.0 Release #16406

Merged
merged 36 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
58585c5
parse multipart/form-data for PUT request
sinbadxiii Jul 27, 2023
582bf57
update changelog
sinbadxiii Jul 28, 2023
60cf4ae
Merge pull request #16387 from sinbadxiii/issue-16271
niden Jul 28, 2023
ebf388d
minor adjustments
niden Nov 18, 2022
0851534
clearing reusable cache on getRelated delete
niden Nov 18, 2022
bdeb25d
fixing cli tests
niden Nov 18, 2022
a7ac0bc
adjusting test
niden Jul 30, 2023
696ea52
correting test
niden Jul 30, 2023
6c65a50
test corrections
niden Jul 30, 2023
d33b505
Merge pull request #16215 from niden/T16214-delete-getrelated
niden Jul 31, 2023
11b830e
adjusting api doc generation
niden Jul 26, 2023
837dcd6
Refactored Model, added Loader::isRegistered [#16391]
rudiservo Aug 6, 2023
f3f6cc8
Fixed Phalcon\Mvc\Model\Metadata::initialize behaviour [#16393]
rudiservo Aug 6, 2023
78694f0
more validation tests
niden Aug 9, 2023
e837d98
fixing changelog
niden Aug 9, 2023
185d627
Added addHeader() in the builder
niden Aug 9, 2023
0725c21
more test coverage for JWT
niden Aug 9, 2023
dbc9102
phpcs
niden Aug 9, 2023
b77710e
phpcs again
niden Aug 9, 2023
e7f9d9c
updating changelog
niden Aug 9, 2023
686960d
Merge pull request #16397 from niden/T16396-jwt-addheader
niden Aug 10, 2023
d09643f
Merge pull request #16392 from rudiservo/5.0.x
Jeckerson Aug 10, 2023
9feaefb
Fix #16343, DynamicUpdate is now enabled system wide
rudiservo Aug 10, 2023
302c38d
Merge pull request #16400 from rudiservo/i16343
niden Aug 12, 2023
05589ec
Remove set of 'application' service
Jeckerson Aug 15, 2023
3fc5700
Remove redundant tests
Jeckerson Aug 15, 2023
cf60c93
Fix typo
Jeckerson Aug 15, 2023
c2ddce6
Update changelog
Jeckerson Aug 15, 2023
3532098
Change next version to `5.3.0`
Jeckerson Aug 15, 2023
60d0829
Change next version to `5.3.0`
Jeckerson Aug 15, 2023
f6f342e
Merge pull request #16404 from phalcon/fix-memory-leak
Jeckerson Aug 15, 2023
ad912e6
prep for 5.3.0
niden Aug 15, 2023
8f5db8e
refreshing ext
niden Aug 15, 2023
a10fb5c
adjusting changelog
niden Aug 15, 2023
b857429
refreshing build files
niden Aug 15, 2023
df62245
Merge pull request #16405 from niden/5.0.x
Jeckerson Aug 15, 2023
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 CHANGELOG-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@

- Parse multipart/form-data from PUT request [#16271](https://github.com/phalcon/cphalcon/issues/16271)

### Added

- Added `Phalcon\Encryption\Security\JWT\Builder::addHeader()` to allow adding custom headers [#16396](https://github.com/phalcon/cphalcon/issues/16396)


## [5.2.3](https://github.com/phalcon/cphalcon/releases/tag/v5.2.3) (2023-07-26)

### Fixed

- Tried to reproduce the behavior described in #16244 but had no success. [#16244](https://github.com/phalcon/cphalcon/issues/16244)
- Extended `Phalcon\Di\Injectable` from `stdClass` to remove the deprecation warning (dynamic properties) for PHP 8.2 [#16308](https://github.com/phalcon/cphalcon/issues/16308)
- Corrected the return type of `Phalcon\Mvc\View::getVar()` so that stubs can be accurate. [#16276](https://github.com/phalcon/cphalcon/issues/16276)
Expand All @@ -18,6 +23,7 @@
- Fixed `Phalcon\Http\Request::getJsonRawBody` to protect from empty body [#16373](https://github.com/phalcon/cphalcon/issues/16373)

### Added

- Added `getAdapter()` in `Phalcon\Mvc\Model\Metadata` to retrieve the internal cache adapter if necessary. [#16244](https://github.com/phalcon/cphalcon/issues/16244)
- Added `Phalcon\Storage\Adapter\Weak` implemented with WeakReference has a cache/retrieval solution for objects not yet collected by the Garbage Collection. [#16372](https://github.com/phalcon/cphalcon/issues/16372)

Expand Down
24 changes: 23 additions & 1 deletion phalcon/Encryption/Security/JWT/Builder.zep
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ use Phalcon\Support\Collection\CollectionInterface;
use Phalcon\Support\Helper\Json\Encode;

/**
* JWT Builder
* Builder
*
* The builder offers
*
* @property CollectionInterface $claims
* @property CollectionInterface $jose
* @property string $passphrase
* @property SignerInterface $signer
*
* @link https://tools.ietf.org/html/rfc7519
*/
Expand Down Expand Up @@ -103,6 +110,21 @@ class Builder
return this;
}

/**
* Adds a custom claim
*
* @param string $name
* @param mixed $value
*
* @return Builder
*/
public function addHeader(string! name, var value) -> <Builder>
{
this->jose->set(name, value);

return this;
}

/**
* @return array|string
*/
Expand Down
10 changes: 10 additions & 0 deletions phalcon/Encryption/Security/JWT/Token/Token.zep
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class Token
}

/**
* Return the registered claims
*
* @return Item
*/
public function getClaims() -> <Item>
Expand All @@ -64,6 +66,8 @@ class Token
}

/**
* Return the registered headers
*
* @return Item
*/
public function getHeaders() -> <Item>
Expand All @@ -72,6 +76,8 @@ class Token
}

/**
* Return the payload
*
* @return string
*/
public function getPayload() -> string
Expand All @@ -80,6 +86,8 @@ class Token
}

/**
* Return the signature
*
* @return Signature
*/
public function getSignature() -> <Signature>
Expand All @@ -88,6 +96,8 @@ class Token
}

/**
* Return the token
*
* @return string
*/
public function getToken() -> string
Expand Down
36 changes: 36 additions & 0 deletions phalcon/Encryption/Security/JWT/Validator.zep
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,23 @@ class Validator
];
}

/**
* Return an array with validation errors (if any)
*
* @return array
*/
public function getErrors() -> array
{
return this->errors;
}

/**
* Return the value of a claim
*
* @param string $claim
*
* @return mixed
*/
public function get(string claim) -> mixed | null
{
if isset this->claims[claim] {
Expand All @@ -78,6 +90,14 @@ class Validator
return null;
}

/**
* Set the value of a claim, for comparison with the token values
*
* @param string $claim
* @param mixed $value
*
* @return Validator
*/
public function set(string claim, var value) -> <Validator>
{
let this->claims[claim] = value;
Expand All @@ -86,6 +106,8 @@ class Validator
}

/**
* Set the token to be validated
*
* @param Token $token
*
* @return Validator
Expand All @@ -98,6 +120,8 @@ class Validator
}

/**
* Validate the audience
*
* @param string|array $audience
*
* @return Validator
Expand Down Expand Up @@ -129,6 +153,8 @@ class Validator
}

/**
* Validate the expiration time of the token
*
* @param int $timestamp
*
* @return Validator
Expand All @@ -151,6 +177,8 @@ class Validator
}

/**
* Validate the id of the token
*
* @param string $id
*
* @return Validator
Expand All @@ -170,6 +198,8 @@ class Validator
}

/**
* Validate the issued at (iat) of the token
*
* @param int $timestamp
*
* @return Validator
Expand All @@ -189,6 +219,8 @@ class Validator
}

/**
* Validate the issuer of the token
*
* @param string $issuer
*
* @return Validator
Expand All @@ -208,6 +240,8 @@ class Validator
}

/**
* Validate the notbefore (nbf) of the token
*
* @param int $timestamp
*
* @return Validator
Expand All @@ -227,6 +261,8 @@ class Validator
}

/**
* Validate the signature of the token
*
* @param SignerInterface $signer
* @param string $passphrase
*
Expand Down
3 changes: 2 additions & 1 deletion tests/_config/generate-api-docs.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
layout: default
title: '{$document['title']}'
---
{%- include env-setup.html -%}
";
foreach ($document['docs'] as $file) {
$link = str_replace(['.zep', DIRECTORY_SEPARATOR], ['', '\\'], $file);
Expand Down Expand Up @@ -86,7 +87,7 @@

<h1 id=\"{$href}\">{$signature}</h1>

[Source on GitHub](https://github.com/phalcon/cphalcon/blob/v{{ pageVersion }}.0/phalcon/{$github})
[Source on GitHub](https://github.com/phalcon/cphalcon/blob/{{ pageVersion }}.x/phalcon/{$github})
";

if (!empty($namespace)) {
Expand Down
Loading
Loading