├── .gitattributes ├── .github └── workflows │ ├── ci_action.yml │ └── docker_action.yml ├── .gitignore ├── .idea ├── .gitignore └── vcs.xml ├── .vscode └── launch.json ├── Cargo.toml ├── Dockerfile.github-action ├── Dockerfile.local ├── LICENSE ├── README.md ├── diesel.toml ├── docker-compose.local.yml ├── docker-compose.prod.yml ├── docker-compose.stg.yml ├── dotenv.sample ├── libs └── windows │ ├── libcrypto-1_1-x64.dll │ ├── libiconv-2.dll │ ├── libintl-9.dll │ ├── libpq.dll │ ├── libpq.lib │ ├── libssl-1_1-x64.dll │ ├── libwinpthread-1.dll │ ├── sqlite3.def │ ├── sqlite3.dll │ ├── sqlite3.exp │ ├── sqlite3.lib │ └── zlib1.dll ├── migrations ├── .gitkeep ├── 00000000000000_diesel_initial_setup │ ├── down.sql │ └── up.sql ├── 2018-12-05-031038_create_people_table │ ├── down.sql │ └── up.sql ├── 2018-12-06-070116_create_users_table │ ├── down.sql │ └── up.sql ├── 2019-02-20-054109_create_login_history_table │ ├── down.sql │ └── up.sql └── 2019-02-21-045853_add_login_session_field_to_users_table │ ├── down.sql │ └── up.sql ├── rustfmt.toml ├── src ├── api │ ├── account_controller.rs │ ├── address_book_controller.rs │ ├── mod.rs │ └── ping_controller.rs ├── config │ ├── app.rs │ ├── db.rs │ └── mod.rs ├── constants.rs ├── error.rs ├── main.rs ├── middleware │ ├── auth_middleware.rs │ └── mod.rs ├── models │ ├── filters.rs │ ├── login_history.rs │ ├── mod.rs │ ├── pagination.rs │ ├── person.rs │ ├── response.rs │ ├── user.rs │ └── user_token.rs ├── schema.rs ├── secret.key.sample ├── services │ ├── account_service.rs │ ├── address_book_service.rs │ └── mod.rs └── utils │ ├── mod.rs │ └── token_utils.rs └── wait-for-it.sh /.gitattributes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/.gitattributes -------------------------------------------------------------------------------- /.github/workflows/ci_action.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/.github/workflows/ci_action.yml -------------------------------------------------------------------------------- /.github/workflows/docker_action.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/.github/workflows/docker_action.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/.gitignore -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/.idea/vcs.xml -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/.vscode/launch.json -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/Cargo.toml -------------------------------------------------------------------------------- /Dockerfile.github-action: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/Dockerfile.github-action -------------------------------------------------------------------------------- /Dockerfile.local: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/Dockerfile.local -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/README.md -------------------------------------------------------------------------------- /diesel.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/diesel.toml -------------------------------------------------------------------------------- /docker-compose.local.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/docker-compose.local.yml -------------------------------------------------------------------------------- /docker-compose.prod.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/docker-compose.prod.yml -------------------------------------------------------------------------------- /docker-compose.stg.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/docker-compose.stg.yml -------------------------------------------------------------------------------- /dotenv.sample: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/dotenv.sample -------------------------------------------------------------------------------- /libs/windows/libcrypto-1_1-x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/libs/windows/libcrypto-1_1-x64.dll -------------------------------------------------------------------------------- /libs/windows/libiconv-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/libs/windows/libiconv-2.dll -------------------------------------------------------------------------------- /libs/windows/libintl-9.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/libs/windows/libintl-9.dll -------------------------------------------------------------------------------- /libs/windows/libpq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/libs/windows/libpq.dll -------------------------------------------------------------------------------- /libs/windows/libpq.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/libs/windows/libpq.lib -------------------------------------------------------------------------------- /libs/windows/libssl-1_1-x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/libs/windows/libssl-1_1-x64.dll -------------------------------------------------------------------------------- /libs/windows/libwinpthread-1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/libs/windows/libwinpthread-1.dll -------------------------------------------------------------------------------- /libs/windows/sqlite3.def: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/libs/windows/sqlite3.def -------------------------------------------------------------------------------- /libs/windows/sqlite3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/libs/windows/sqlite3.dll -------------------------------------------------------------------------------- /libs/windows/sqlite3.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/libs/windows/sqlite3.exp -------------------------------------------------------------------------------- /libs/windows/sqlite3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/libs/windows/sqlite3.lib -------------------------------------------------------------------------------- /libs/windows/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/libs/windows/zlib1.dll -------------------------------------------------------------------------------- /migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /migrations/00000000000000_diesel_initial_setup/down.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/migrations/00000000000000_diesel_initial_setup/down.sql -------------------------------------------------------------------------------- /migrations/00000000000000_diesel_initial_setup/up.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/migrations/00000000000000_diesel_initial_setup/up.sql -------------------------------------------------------------------------------- /migrations/2018-12-05-031038_create_people_table/down.sql: -------------------------------------------------------------------------------- 1 | -- This file should undo anything in `up.sql` 2 | DROP TABLE people -------------------------------------------------------------------------------- /migrations/2018-12-05-031038_create_people_table/up.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/migrations/2018-12-05-031038_create_people_table/up.sql -------------------------------------------------------------------------------- /migrations/2018-12-06-070116_create_users_table/down.sql: -------------------------------------------------------------------------------- 1 | -- This file should undo anything in `up.sql` 2 | DROP TABLE users; -------------------------------------------------------------------------------- /migrations/2018-12-06-070116_create_users_table/up.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/migrations/2018-12-06-070116_create_users_table/up.sql -------------------------------------------------------------------------------- /migrations/2019-02-20-054109_create_login_history_table/down.sql: -------------------------------------------------------------------------------- 1 | -- This file should undo anything in `up.sql` 2 | DROP TABLE login_history; -------------------------------------------------------------------------------- /migrations/2019-02-20-054109_create_login_history_table/up.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/migrations/2019-02-20-054109_create_login_history_table/up.sql -------------------------------------------------------------------------------- /migrations/2019-02-21-045853_add_login_session_field_to_users_table/down.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/migrations/2019-02-21-045853_add_login_session_field_to_users_table/down.sql -------------------------------------------------------------------------------- /migrations/2019-02-21-045853_add_login_session_field_to_users_table/up.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/migrations/2019-02-21-045853_add_login_session_field_to_users_table/up.sql -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | reorder_imports = true 2 | -------------------------------------------------------------------------------- /src/api/account_controller.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/api/account_controller.rs -------------------------------------------------------------------------------- /src/api/address_book_controller.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/api/address_book_controller.rs -------------------------------------------------------------------------------- /src/api/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/api/mod.rs -------------------------------------------------------------------------------- /src/api/ping_controller.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/api/ping_controller.rs -------------------------------------------------------------------------------- /src/config/app.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/config/app.rs -------------------------------------------------------------------------------- /src/config/db.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/config/db.rs -------------------------------------------------------------------------------- /src/config/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/config/mod.rs -------------------------------------------------------------------------------- /src/constants.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/constants.rs -------------------------------------------------------------------------------- /src/error.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/error.rs -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/main.rs -------------------------------------------------------------------------------- /src/middleware/auth_middleware.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/middleware/auth_middleware.rs -------------------------------------------------------------------------------- /src/middleware/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod auth_middleware; 2 | -------------------------------------------------------------------------------- /src/models/filters.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/models/filters.rs -------------------------------------------------------------------------------- /src/models/login_history.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/models/login_history.rs -------------------------------------------------------------------------------- /src/models/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/models/mod.rs -------------------------------------------------------------------------------- /src/models/pagination.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/models/pagination.rs -------------------------------------------------------------------------------- /src/models/person.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/models/person.rs -------------------------------------------------------------------------------- /src/models/response.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/models/response.rs -------------------------------------------------------------------------------- /src/models/user.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/models/user.rs -------------------------------------------------------------------------------- /src/models/user_token.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/models/user_token.rs -------------------------------------------------------------------------------- /src/schema.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/schema.rs -------------------------------------------------------------------------------- /src/secret.key.sample: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/secret.key.sample -------------------------------------------------------------------------------- /src/services/account_service.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/services/account_service.rs -------------------------------------------------------------------------------- /src/services/address_book_service.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/services/address_book_service.rs -------------------------------------------------------------------------------- /src/services/mod.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/services/mod.rs -------------------------------------------------------------------------------- /src/utils/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod token_utils; 2 | -------------------------------------------------------------------------------- /src/utils/token_utils.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/src/utils/token_utils.rs -------------------------------------------------------------------------------- /wait-for-it.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SakaDream/actix-web-rest-api-with-jwt/HEAD/wait-for-it.sh --------------------------------------------------------------------------------