Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[2.3][SECURITY] Add remember me cookie configuration #14491

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

Closed
wants to merge 13 commits into from
Closed

[2.3][SECURITY] Add remember me cookie configuration #14491

wants to merge 13 commits into from

Conversation

klaascuvelier
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #14490
License MIT
Doc PR

@klaascuvelier klaascuvelier changed the title Add remember me cookie configuration [2.3][SECURITY] Add remember me cookie configuration Apr 28, 2015
@klaascuvelier
Copy link
Contributor Author

Apparently this build fails on Jenkins, but it appears to be on some unrelated tests.
All tests did succeed locally.

Any ideas how to proceed here?

1,
$this->options['path'],
$this->options['domain'],
isset($this->options['secure']) ? $this->options['secure'] : false,
Copy link
Contributor

Choose a reason for hiding this comment

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

What about using array_merge in constructor to be sure that this options always exists?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But what is the advantage of that?

If an array_merge should be added, it would not have to be here, but at the point of reading the the config file imo

Copy link
Contributor

Choose a reason for hiding this comment

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

Big advantage for me: I see full default configuration in the constructor. So no need scroll down to line no 296 for getting default value of secure parameter. Also I see full list of options that available in this class.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is common practice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I see your point @Koc.
Updated the PR!

@xabbuh xabbuh added the Security label May 1, 2015
@klaascuvelier
Copy link
Contributor Author

So all checks passed this time, not sure what the next steps are.
cc @fabpot

@sstok
Copy link
Contributor

sstok commented Sep 22, 2015

Can you add some tests to prevent future breakage?
See #14843 for an example.

Status: needs work

@klaascuvelier
Copy link
Contributor Author

@sstok I'll look in to it.
When I did this, should I remove the needs work label myself, so somebody takes another look at it?

@klaascuvelier
Copy link
Contributor Author

@sstok test has been added.

@sstok
Copy link
Contributor

sstok commented Sep 24, 2015

Apply the Fabbot patch and this should be good http://fabbot.io/report/symfony/symfony/14491/78eb0fd7b5cd9554943c610e315441715c3b629f#patchcs

@klaascuvelier
Copy link
Contributor Author

@sstok yeah sorry about the standards, it's applied, redoing tests.

@klaascuvelier
Copy link
Contributor Author

What will be the necessary steps to get this on the newer versions of Symfony? (2.7, 2.8)

@klaascuvelier
Copy link
Contributor Author

@sstok
Copy link
Contributor

sstok commented Sep 24, 2015

The 2.3 branch is merged into the 2.7 and eventually 2.8 and master on a weekly basis.
Appveyor failure is unrelated.

Status: Reviewed

@klaascuvelier
Copy link
Contributor Author

@sstok can you fill me in on what the next steps are? Do I just wait until it gets merged in, or do I have to do something else myself?

@klaascuvelier
Copy link
Contributor Author

So apparently this one got merged instead: #14842

Kind of weird my solution was overlooked @sstok @fabpot .

@xabbuh
Copy link
Member

xabbuh commented Oct 6, 2015

@klaascuvelier I am sorry that your pull request has been overlooked. However, your solution has the advantage that it does not fail when one of the new options is omitted. Would you mind rebasing your PR on the latest 2.3 branch to modify the existing behaviour such that these options will be ignored when not passed?

@klaascuvelier
Copy link
Contributor Author

@xabbuh it appears my tests are failing due to the merge of #16139
I see in that ticket a remark like "oops I merged this too soon". How is this possible?

@xabbuh
Copy link
Member

xabbuh commented Oct 6, 2015

@klaascuvelier Imho you ignore those failures for the moment and just rebase your changes on the latest commit of the 2.3 branch.

@klaascuvelier
Copy link
Contributor Author

@xabbuh, I actually did that, if I do git fetch upstream && git merge upstream/2.3 again it tells me Already up-to-date. so doing another rebase seems pointless to me, no?

I might wait for this one to get merged and do another rebase? #16141

@fabpot
Copy link
Member

fabpot commented Oct 6, 2015

#16141 has been merged now.

@xabbuh
Copy link
Member

xabbuh commented Oct 6, 2015

@klaascuvelier Well, it looks a bit strange that your PR contains the commit made by @nicolas-grekas. However, the diff looks right. Could you please also revert the changes to the test classes made in #14842 where the default values are set for the options?

@fabpot
Copy link
Member

fabpot commented Oct 6, 2015

That's because you did a merge, not a rebase. We need a rebase to keep the history clean.

@klaascuvelier
Copy link
Contributor Author

I did a rebase from 2.3, like described here: http://symfony.com/doc/current/contributing/code/patches.html#step-3-submit-your-patch
but with 2.3 instead of master

@klaascuvelier
Copy link
Contributor Author

Can you tell me what exactly you want me to do, to fix this mess-up?

@fabpot
Copy link
Member

fabpot commented Oct 6, 2015

This should work:

git fetch upstream
git rebase upstream/2.3

From your branch.

@klaascuvelier
Copy link
Contributor Author

Okay, I did a new rebase, PR looks better now.
The reason the other commit came in was probably because I did a git push origin SECURE_COOKIE, with --force, it failed, I git pulled and repushed. I noticed now the info on the contributing page explicitly states to use --force, which I did now.

@xabbuh
Copy link
Member

xabbuh commented Oct 6, 2015

This looks better. Could you also modify the test classes as described in #14491 (comment)?

$this->options['secure'],
$this->options['httponly']
)
);
Copy link
Member

Choose a reason for hiding this comment

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

should be kept on one line

@klaascuvelier
Copy link
Contributor Author

Alright, fixed both of your remarks as well.

@xabbuh
Copy link
Member

xabbuh commented Oct 6, 2015

They should be revert in PersistentTokenBasedRememberMeServicesTest and TokenBasedRememberMeServicesTest too.

@klaascuvelier
Copy link
Contributor Author

Anything I can do about the failing tests?

@fabpot
Copy link
Member

fabpot commented Oct 6, 2015

Nope, they're going to be fixed by other PRs.

@fabpot
Copy link
Member

fabpot commented Oct 6, 2015

Thank you @klaascuvelier.

fabpot added a commit that referenced this pull request Oct 6, 2015
…aascuvelier)

This PR was squashed before being merged into the 2.3 branch (closes #14491).

Discussion
----------

[2.3][SECURITY] Add remember me cookie configuration

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #14490
| License       | MIT
| Doc PR        |

Commits
-------

e8f0e5a [2.3][SECURITY] Add remember me cookie configuration
@fabpot fabpot closed this Oct 6, 2015
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.

6 participants