stable

Clone or download

Read-only

Create the base architecture to create an OAuth2 access token from an authorization code

For now, an access token is issued for the 'admin' user with a 'demo' scope to anyone doing a POST request on the route. This token can be used against the test resource route. No verification is done before issuing the OAuth2 access token. All the required verification will be progressively added in future contribution. You can test as follow: shell> curl -X POST https://tuleap.example.com/plugins/oauth2_server/access_token shell> curl \ -H 'Authorization: Bearer <token_retrieved_from_the_previous_response>' \ https://tuleap.example.com/plugins/oauth2_server/testendpoint This is part of story #14542: have OAuth2 flow Change-Id: I71430653dd249e8c7099915dc2a902b5f4834800

Modified Files

Name
A plugins/oauth2_server/include/AccessToken/OAuth2AccessTokenCreator.php +106 −0 Go to diff View file
A plugins/oauth2_server/include/AccessToken/OAuth2AccessTokenWithIdentifier.php +56 −0 Go to diff View file
A plugins/oauth2_server/include/AccessToken/Scope/OAuth2AccessTokenScopeSaver.php +54 −0 Go to diff View file
A plugins/oauth2_server/include/Grant/AuthCodeGrantController.php +83 −0 Go to diff View file
A plugins/oauth2_server/include/Grant/AuthorizationCodeGrantResponseBuilder.php +51 −0 Go to diff View file
A plugins/oauth2_server/include/Grant/CannotSetANegativeExpirationDelayOnAccessTokenException.php +35 −0 Go to diff View file
A plugins/oauth2_server/include/Grant/OAuth2AccessTokenSuccessfulRequestRepresentation.php +64 −0 Go to diff View file
A plugins/oauth2_server/include/Grant/OAuth2AuthorizationCode.php +78 −0 Go to diff View file
A plugins/oauth2_server/include/OAuth2ServerException.php +29 −0 Go to diff View file
M plugins/oauth2_server/include/oauth2_serverPlugin.php +34 −3 Go to diff View file
A plugins/oauth2_server/phpunit/AccessToken/OAuth2AccessTokenCreatorTest.php +115 −0 Go to diff View file
A plugins/oauth2_server/phpunit/AccessToken/Scope/OAuth2AccessTokenScopeSaverTest.php +66 −0 Go to diff View file
A plugins/oauth2_server/phpunit/Grant/AuthCodeGrantControllerTest.php +62 −0 Go to diff View file
A plugins/oauth2_server/phpunit/Grant/AuthorizationCodeGrantResponseBuilderTest.php +51 −0 Go to diff View file
A plugins/oauth2_server/phpunit/Grant/OAuth2AccessTokenSuccessfulRequestRepresentationTest.php +62 −0 Go to diff View file
A plugins/oauth2_server/phpunit/Grant/OAuth2AuthorizationCodeTest.php +40 −0 Go to diff View file
M src/common/User/OAuth2/AccessToken/OAuth2AccessTokenDAO.php +12 −0 Go to diff View file
M src/common/User/OAuth2/AccessToken/Scope/OAuth2AccessTokenScopeDAO.php +11 −0 Go to diff View file