-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
fix(Authentication): correctly catch uniq constraint on token insert #45126
base: master
Are you sure you want to change the base?
Conversation
d7dbbbe
to
4c8662e
Compare
Signed-off-by: Grigorii K. Shartsev <[email protected]>
4c8662e
to
131dbaf
Compare
@@ -77,18 +77,22 @@ public function generateToken(string $token, | |||
$type, | |||
$remember | |||
); |
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.
Maybe add an @throws OCP\DB\Exception
on generateToken
because it’s not documented currently I think
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.
* @throws Exception
should also work here with use above, right?
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.
It is not part of the expected API behaviour, so from my POV it should not be documented
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.
I was talking about the other generateToken, the one that is called, so
public function generateToken(string $token, |
But it inherits from IProvider, so not sure if easy to document.
I though |
Is there something like a |
@@ -55,6 +55,7 @@ public function __construct(PublicKeyTokenProvider $publicKeyTokenProvider) { | |||
* @param int $type token type | |||
* @param int $remember whether the session token should be used for remember-me | |||
* @return OCPIToken | |||
* @throws Exception |
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.
This is not part of the expected API behaviour, so from my POV it should not be documented
TODO
UniqueConstraintViolationException
toOCP\DB\Exception
in auth token managerChecklist