by. Imam Rafiif Arrazaan
- Make .env based on .env.example and populate the env variables.
- Make sure the GOOGLE_OAUTH_CLIENT_ID and GOOGLE_OAUTH_CLIENT_SECRET is filled correctly. Here is some video that might help when setting the client_id and client_secret link.
- Open the directory terminal and type
make compose-up
- To end the program, open the directory terminal and type
make compose-down
This feature enable user to login with their google account. The access token to use protected feature will be stored as a cookie.
Use this feature using web browser (tested on Google Chrome)
Steps:
- Open browser and enter url {{HOST}}/oauth/google
- Sign in with your google account
- You can enter other feature endpoint then
If you want to use Postman/Insomnia etc. After browser shows Login Success message, inspect element, go to Application, select Cookies, click access_token Cookie, and you can get the access token there.
This feature enable user to get the identity of the searched user by using their firstname as a keyword.
Steps:
- Make sure to add access_token cookie before accessing this feature.
- Enter endpoint {{HOST}}/api/identity?name={{keyword}}.
- Fill the {{keyword}} with wanted identity firstname.
This feature enable user to get Diki final proficiency level as int the task.
Steps:
- Make sure to add access_token cookie before accessing this feature.
- Enter endpoint {{HOST}}/api/identity?n={{var}}&m={{var}}&a={{var}}&b={{var}}.
- Fill the {{var}}.
After running the program, ypu can go to your browser and enter {{HOST}}/swagger/index.html.
OR
Open the directory terminal and type
swag init
Then open the swagger.yaml in docs directory in Swagger Editor
swag use swaggo/swag
- Access Token is stored as cookie and need to be used as cookie to use protected feature. Swagger 2.0 can not use cookie as a Header.
- User login from browser with their google account.
- Make sure DB env variables in .env file are synced with the env variables in the docker-compose.yml file.
- Unit testing only be done for the services layer.