-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Private claims implementation #1122
Open
skroczek
wants to merge
40
commits into
thephpleague:9.0.0-WIP
Choose a base branch
from
skroczek:wip/private-claims
base: 9.0.0-WIP
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
517403b
Basic implementation of private claims
skroczek aefdde5
Adds private claims to the grant types
skroczek f6d5ed0
Fixes styles
skroczek 962506e
Makes ClaimRepository optional in AuthorizationServer constructor.
skroczek d2888f1
Fixes styles II
skroczek 3630fc7
Adds testing for claims
skroczek 108b1ee
Fixes style of claim entity stub
skroczek 8dd31f5
Fixes phpstan errors
skroczek 12d8643
Removes unused JsonSerializable interface
skroczek d6d45d9
Adds ClaimEntityTrait
skroczek ba02f3b
Removes useless claim parameter
skroczek 7ac954b
Removes confusing ClaimEntity argument
skroczek c659a19
Asserts that the claim has been set
skroczek 8e1473c
Fixes cs
skroczek 7256a3c
Fixes phpstan error
skroczek f0a3e97
Adds and uses TokenInterface::addClaim() method and removes $claims p…
skroczek 381e415
Revert formatting change
Sephster 1db5e24
Fix formatting issue
Sephster 9891fdb
Add blank line above block
Sephster e8b1942
Fix formatting and make if check more explicit
Sephster 970ef40
Fix formatting and make if check more explicit
Sephster 5bd8127
Fix formatting and make if check more explicit
Sephster 162a02e
Fix formatting and make if check more explicit
Sephster 88b5705
Fix formatting and make if check more explicit
Sephster 1842975
Fix formatting and make if check more explicit
Sephster 74a934e
Revert docblock hint change as not required for this PR
Sephster 40fed67
Revert formatting change
Sephster d240052
Changes copyright
skroczek b8141f9
Merge remote-tracking branch 'upstream/master' into wip/private-claims
Sephster 6bcff56
StyleCI fix
Sephster 73f49e5
Merge in 9.0.0 branch
Sephster 568c787
Apply StyleCI change
Sephster 0aef818
Fix test
Sephster d43c63c
StyleCI fixes
Sephster 5a71aaf
Update changelog
Sephster 1d79e35
Remove getClaims and addClaim from TokenInterface
Sephster 6710412
Add method exists for addClaim on token
Sephster 0302141
StyleCI fixes
Sephster dc2f7ac
Merge remote-tracking branch 'upstream/9.0.0-WIP' into wip/private-cl…
JRogaishio 2ea4450
Merge pull request #1 from JRogaishio/wip/private-claims
skroczek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,27 @@ | ||
<?php | ||
/** | ||
* @author Sebastian Kroczek <[email protected]> | ||
* @copyright Copyright (c) Alex Bilbie | ||
* @license http://mit-license.org/ | ||
* | ||
* @link https://github.com/thephpleague/oauth2-server | ||
*/ | ||
|
||
namespace League\OAuth2\Server\Entities; | ||
|
||
interface ClaimEntityInterface | ||
{ | ||
/** | ||
* Get the claim's name. | ||
* | ||
* @return string | ||
*/ | ||
public function getName(); | ||
|
||
/** | ||
* Get the claim's value | ||
* | ||
* @return mixed | ||
*/ | ||
public function getValue(); | ||
} |
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,43 @@ | ||
<?php | ||
/** | ||
* @author Sebastian Kroczek <[email protected]> | ||
* @copyright Copyright (c) Alex Bilbie | ||
* @license http://mit-license.org/ | ||
* | ||
* @link https://github.com/thephpleague/oauth2-server | ||
*/ | ||
|
||
namespace League\OAuth2\Server\Entities\Traits; | ||
|
||
trait ClaimEntityTrait | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $name; | ||
|
||
/** | ||
* @var mixed | ||
*/ | ||
protected $value; | ||
|
||
/** | ||
* Returns the name of the claim | ||
* | ||
* @return string | ||
*/ | ||
public function getName() | ||
{ | ||
return $this->name; | ||
} | ||
|
||
/** | ||
* Returns the claims value | ||
* | ||
* @return mixed | ||
*/ | ||
public function getValue() | ||
{ | ||
return $this->value; | ||
} | ||
} |
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, sorry for the (very) late comment. But just got an email that people are interested again.
Maybe just personal preference, but checking if something is not null is not actually checking anything (because it can be ANYTHING at this point).
I'd rather check if it is what I want it to be, e.g. an instanceof check.