10485[BUGFIX] Only create one keypair in rsaauth
Commit message
Review
-
Code review CR +2
- Markus Klein +2
- Stefan Neufeind +1
- Daniel Gorges +1
- Benni Mack +1
-
Verified V +2
- Markus Klein +2
- Daniel Gorges +1
- Benni Mack +1
Files 8
- typo3/sysext/rsaauth/Classes/Backend/AbstractBackend.php+6 −3
- typo3/sysext/rsaauth/Classes/Backend/CommandLineBackend.php+30 −14
- typo3/sysext/rsaauth/Classes/Backend/PhpBackend.php+22 −14
- typo3/sysext/rsaauth/Classes/Hook/FrontendLoginHook.php+5 −1
- typo3/sysext/rsaauth/Classes/Keypair.php6+77 −15
- typo3/sysext/rsaauth/Tests/Unit/Backend/CommandLineBackendTest.phpnew+78 −0
- typo3/sysext/rsaauth/Tests/Unit/Backend/PhpBackendTest.phpnew+68 −0
- typo3/sysext/rsaauth/Tests/Unit/KeypairTest.phpnew+213 −0
Review log 51
Show 26 earlier messages
-
Dmitry Dulepov commented on patch set 1 05/27/13, 17:19
Fails; I would prefer that you didn't submit this There are major changes in the behavior and API. It is now incompatible with existing. Please, make sure that your change is fully compatibile with previous versions. Rsaauth is a public sysext, it can be used from anywhere, not just from the core. Your change can break any external ext.class.tx_rsaauth_feloginhook.php:68Use the existing function.class.tx_rsaauth_loginformhook.php:53Use the existing function.class.tx_rsaauth_usersetuphook.php:94Use the existing function.class.tx_rsaauth_abstract_backend.php:61Keep the declared API as is. There is no need for the new function here. Just describe the behavior change.class.tx_rsaauth_cmdline_backend.php:78Use the existing function.class.tx_rsaauth_keypair.php:41If you remove this value, you have to make a constructor, which sets it. Otherwise the current behavior will be broken. So far neither of "set" methods were mandatory. With you change they become mandatory without any prior notice. This is a no go.class.tx_rsaauth_keypair.php:48Same as above.class.tx_rsaauth_keypair.php:55Same as above.class.tx_rsaauth_php_backend.php:43Use the existing function. -
Marco Huber uploaded patch set 2 05/27/13, 17:19
class.tx_rsaauth_keypair.php:63I'm unsure if this one works. -
Dmitry Dulepov commented on patch set 3 5 comments 05/27/13, 17:19
I would prefer that you didn't submit this Thanks for reworking! I have some more comments. -
Oliver Klee commented on patch set 3 05/27/13, 17:19
(4 inline comments) -
Marco Huber uploaded patch set 3 05/27/13, 17:19
-
Marco Huber commented on patch set 3 05/27/13, 17:19
(1 inline comment) Thank you for your comments Dmitry, I reworked the patch. -
Oliver Klee commented on patch set 4 05/27/13, 17:19
I'll rework the patch to use gaurd clauses where it makes sense. -
Oliver Klee uploaded patch set 5 05/27/13, 17:19
-
Dmitry Dulepov commented on patch set 6 05/27/13, 17:19
Looks like hard-to-create unit tests hold the nice patch for too long... Shouldn't we be more pragmatic and submit this without unit tests? -
Stefan Neufeind commented on patch set 6 05/27/13, 17:19
@Oliver: Since you seem to have an idea for the needed tests and they seem to mean a lot to you, could you maybe go for an initial version of tests? (This is not meant as an offense. I just have the feeling we're getting nowhere because of the current deadlock.) -
Stefan Neufeind commented on patch set 6 05/27/13, 17:19
@Oliver: I expect it's not too easy to write an automated testcase for this. Do you maybe have some idea how to "mock" that test? Should be easy to test by hand but ... -
Stefan Neufeind commented on patch set 6 05/27/13, 17:19
please pick this one up again -
Oliver Klee commented on patch set 6 05/27/13, 17:19
I've changed the functions to guard clauses, cleaned up some things, changed the exceptions to BadMethodCallExceptions and fixed a few spelling mistakes. However, I have no idea how to test this. I'm also not too happy with the current function naming (as the old names don't fit the new behavior). The checks with the exceptions also could be improved. Currently, the message is about calling the set* functions to times, but the check is about isReady. -
Oliver Klee commented on patch set 6 05/27/13, 17:19
The unit tests won't be that hard to create - someone just needs to invest the time to do so. -
Oliver Klee commented on patch set 6 05/27/13, 17:19
Having some unit tests (that test the expected behavior) would be great. For writing them, knowing the expected behavior would be helpful, of course ... :-) -
Oliver Klee commented on patch set 6 05/27/13, 17:19
I'll try to find some time for the tests this week. -
Oliver Klee uploaded patch set 6 05/27/13, 17:19
-
Oliver Klee commented on patch set 6 05/27/13, 17:19
I would prefer that you didn't submit this -
Oliver Klee commented on patch set 6 05/27/13, 17:19
As far as I can see, the classes except for the hook do not rely on much of an environment, i.e., we could just test for the returned (or changed) data. Concerning the hook: We probably need to have a mock FE (either by createMock('tslib_fe') or with testingFramework->createFakeFrontEnd()) when calling the hook. In addition, StorageFactory::getStorage indirectly calls GeneralUtility::makeInstance. We can provide makeInstance with mocked instance via ::addInstance (for non-singletons). It is important to call GeneralUtility::purgeInstances() in tearDown to get rid of any stored instances so we leave a "clean public lavatory" after the tests have run. I hope this was helpful ... -
Oliver Klee commented on patch set 6 05/27/13, 17:19
I'm currently working on it; hold on. -
Marco Huber uploaded patch set 4 05/27/13, 17:19
-
Marco Huber commented on patch set 4 05/27/13, 17:19
Now createNewKeyPair in the backends only returns something different from NULL if we have a keyPair. -
Marco Huber commented on patch set 4 05/27/13, 17:19
And I fixed the CGL things, of cource ;-) Hopefully I didn't forget one... -
Mr. Jenkins commented on patch set 2 05/27/13, 17:19
Fails; I would prefer that you didn't submit this Build Failed https://ci.typo3.org/job/typo3-v4-core-gerrit/4201/ : FAILURE -
Mr. Jenkins commented on patch set 3 05/27/13, 17:19
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/4202/ : SUCCESS -
Mr. Jenkins commented on patch set 4 05/27/13, 17:19
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/4268/ : SUCCESS
-
Mr. Jenkins commented on patch set 6 05/27/13, 17:19
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/4279/ : SUCCESS -
Stefan Neufeind commented on patch set 6 11/14/13, 17:43
@Oliver: short update please -
Stefan Neufeind commented on patch set 6 1 comment 11/14/13, 17:43
-
Oliver Klee commented on patch set 6 11/14/13, 22:20
I'll do the patch for the Security sprint at the last November weekend.class.tx_rsaauth_cmdline_backend.php:81CGL: MIssing space after the "if". I'd prefer this to be a guard clause.class.tx_rsaauth_keypair.php:63ReplyYou don't need strlen here. You can just do !== '' && !== ''.class.tx_rsaauth_keypair.php:82CGL: MIssing space after the "if". Please switch the if/else to a guard clause. Ditto for the other functions. (Maybe you can also move the isReady check and the throwing into a separate function to avoid the duplication.)class.tx_rsaauth_php_backend.php:46Ditto. -
Michael Staatz voted on patch set 6 CR +1 11/22/13, 09:15
-
Michael Staatz voted on patch set 6 V +1 11/22/13, 09:18
-
Tom voted on patch set 6 V +1 CR +1 11/22/13, 09:22
-
Tom uploaded patch set 7 11/22/13, 10:54
-
Michael Staatz voted on patch set 7 V +1 CR +1 11/22/13, 10:57
-
Markus Klein commented on patch set 7 CR -1 11/22/13, 11:00
Let wait for Oli to finish this patch at the security sprint in a few days. -
Mr. Jenkins commented on patch set 7 11/22/13, 11:09
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/12266/ : SUCCESS -
Oliver Klee uploaded patch set 8 11/29/13, 15:37
-
Mr. Jenkins commented on patch set 8 11/29/13, 15:50
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/12389/ : SUCCESS -
Markus Klein commented on patch set 8 4 comments 11/29/13, 16:16
Please see comments. I'm not sure about CGL here, but do we usually start with uppercase letters for parameter descriptions? -
Oliver Klee commented on patch set 8 11/29/13, 16:25
The CGL do not say anything about the first letter of parameter descriptions: http://docs.typo3.org/typo3cms/CodingGuidelinesReference/PhpFileFormatting/UsingPhpdoc/Index.html I personally prefer lowercase there as these are not full sentences, i.e., they start lowercase and do not have a full stop. -
Oliver Klee uploaded patch set 9 11/29/13, 16:32
-
Mr. Jenkins commented on patch set 9 11/29/13, 16:48
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/12390/ : SUCCESS -
Markus Klein commented on patch set 9 1 comment 11/29/13, 16:56
I'll repush -
Markus Klein voted on patch set 9 CR +1 11/29/13, 16:57
-
Markus Klein commented on patch set 9 1 comment 11/29/13, 17:00
-
Stefan Neufeind commented on patch set 9 CR +1 11/29/13, 17:12
meanwhile: 6.2, 6.1, 6.0, 4.5 -
Benni Mack commented on patch set 9 V +1 CR +1 12/09/13, 16:59
Works like a charm! -
Daniel Gorges commented on patch set 9 V +1 CR +1 12/09/13, 17:06
Check! Works! -
Markus Klein commented on patch set 9 V +2 CR +2 01/09/14, 00:43
Keypair.php:98Superfluous (). Please increase readability.Keypair.php:135Superfluous (). Please increase readability.Keypair.php:152Isn't this usually uppercase? The...Keypair.php:152ups a space is missing now.Keypair.php:152Replyforget it... my mistake in the diff viewKeypair.php:172Superfluous (). Please increase readability. -
Markus Klein merged patch set 10 01/09/14, 00:43