Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Security] Added type-hints to auth providers, tokens and voters #32351

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

Merged
merged 1 commit into from
Jul 4, 2019

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Jul 3, 2019

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #32179
License MIT
Doc PR N/A

This PR adds type declarations to authentication providers, tokens and voters.

@@ -58,7 +58,7 @@ public function getCredentials()
return $this->credentials;
}

public function setAuthenticated($authenticated)
public function setAuthenticated(bool $authenticated)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 This change to security-guard 5 breaks compatibility with security-core 4.4, thus the bump in composer.json. Can be reverted and re-applied later, if you don't want to bump yet.

@derrabus derrabus mentioned this pull request Jul 3, 2019
57 tasks
@@ -83,7 +83,7 @@ public function testRetrieveUserReturnsUserFromTokenOnReauthentication()
$provider = new DaoAuthenticationProvider($userProvider, $this->getMockBuilder('Symfony\\Component\\Security\\Core\\User\\UserCheckerInterface')->getMock(), 'key', $this->getMockBuilder('Symfony\\Component\\Security\\Core\\Encoder\\EncoderFactoryInterface')->getMock());
$reflection = new \ReflectionMethod($provider, 'retrieveUser');
$reflection->setAccessible(true);
$result = $reflection->invoke($provider, null, $token);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 null shouldn't be a valid argument for the retrieveUser method. The test only worked because the parameter is ignored on the execution path that is tested here.

@derrabus derrabus force-pushed the improvement/type-hints-on-auth branch from 5e680c2 to 8c46b95 Compare July 3, 2019 23:03
@@ -48,7 +48,7 @@ public function __construct(Connection $conn)
/**
* {@inheritdoc}
*/
public function loadTokenBySeries($series)
public function loadTokenBySeries(string $series)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 These changes to doctrine-bridge 5 break compatibility with security-core 4.4, thus the bump in composer.json. Can be reverted and re-applied later, if you don't want to bump yet.

@fabpot
Copy link
Member

fabpot commented Jul 4, 2019

Thank you @derrabus.

@fabpot fabpot merged commit 8c46b95 into symfony:master Jul 4, 2019
fabpot added a commit that referenced this pull request Jul 4, 2019
…d voters (derrabus)

This PR was merged into the 5.0-dev branch.

Discussion
----------

[Security] Added type-hints to auth providers, tokens and voters

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #32179
| License       | MIT
| Doc PR        | N/A

This PR adds type declarations to authentication providers, tokens and voters.

Commits
-------

8c46b95 [Security] Added type-hints to auth providers, tokens and voters.
@derrabus derrabus deleted the improvement/type-hints-on-auth branch July 4, 2019 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.