title=Development date=2014-06-04 type=page status=published
P4OAuth Development
===================
Most of the build tasks are run using [gradle](http://www.gradle.org), which is generally what your IDE should be able to import for doing development. This has only been imported with IDEA, which works, so YMMV if you use anything else like Eclipse.
## Testing
The only tests right now are system tests developed in the `functional_tests` subproject. To run, you'll need:
1. A running p4d
2. A running p4oauth server
3. An example "Test server" of a test client integration
The tests themselves use [TestNG](http://testng.org/doc/index.html), but assume the above services are running.
You *can* use the following gradle tasks to set up your environment. These gradle commands should set up a keystore for you using the `keytool` command. They also set up temporary working configurations which you might find useful.
#### Setup p4d
This command really only needs to be run once:
% cd functional_tests
% ./gradlew initPerforce
From there, a p4d should be running at `localhost:1666`.
You can restart the p4d instance via:
% cd functional_tests
% ./gradlew startPerforce
In general though, the other services will do this automatically.
##### Start/Stop p4oauth
If you want, you can execute a p4oauth service in the background:
% ./gradlew assemble
% cd functional_tests
% ./gradlew startP4Oauth
This runs P4OAuth using the `p4oauth.jar` that should be built in the `build/libs` folder of the project.
#### Start/Stop Test Server
A test client server is used by tests that access the local p4d and list files (to just ensure we can in fact do something with the login token). Like p4oauth, you'll have to first assemble the test server.
% cd functional_tests
% ./gradlew :test_server:assemble
% ./gradlew startTestServer
To Do List
==========
1. Define and document kinds of error situations when the user may have a bad set of p4d tokens
title=Development date=2014-06-04 type=page status=published ~~~~~~ P4OAuth Development =================== Most of the build tasks are run using [gradle](http://www.gradle.org), which is generally what your IDE should be able to import for doing development. This has only been imported with IDEA, which works, so YMMV if you use anything else like Eclipse. ## Testing The only tests right now are system tests developed in the `functional_tests` subproject. To run, you'll need: 1. A running p4d 2. A running p4oauth server 3. An example "Test server" of a test client integration The tests themselves use [TestNG](http://testng.org/doc/index.html), but assume the above services are running. You *can* use the following gradle tasks to set up your environment. These gradle commands should set up a keystore for you using the `keytool` command. They also set up temporary working configurations which you might find useful. #### Setup p4d This command really only needs to be run once: % cd functional_tests % ./gradlew initPerforce From there, a p4d should be running at `localhost:1666`. You can restart the p4d instance via: % cd functional_tests % ./gradlew startPerforce In general though, the other services will do this automatically. ##### Start/Stop p4oauth If you want, you can execute a p4oauth service in the background: % ./gradlew assemble % cd functional_tests % ./gradlew startP4Oauth This runs P4OAuth using the `p4oauth.jar` that should be built in the `build/libs` folder of the project. #### Start/Stop Test Server A test client server is used by tests that access the local p4d and list files (to just ensure we can in fact do something with the login token). Like p4oauth, you'll have to first assemble the test server. % cd functional_tests % ./gradlew :test_server:assemble % ./gradlew startTestServer To Do List ========== 1. Define and document kinds of error situations when the user may have a bad set of p4d tokens
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 9180 | tjuricek |
0.1.1 Adding mechanism for fetching the p4 token given the bearer token on an Authorization header. This is probably secure since we can't use these tokens except for the restricted hosts. |
||
#2 | 9161 | tjuricek | 0.1.0 Minimal p4oauth server that provides a basic authorization code grant. | ||
#1 | 9089 | tjuricek |
Moving some code that worked via some manual validation to the workshop. This just implements a basic code authorization grant scheme. Automated tests are forthcoming, awating some gradle plugin work that should sit outside of this project. |