Mainflux.mainflux/users/README.md

101 lines
5.6 KiB
Markdown
Raw Normal View History

2018-05-11 05:53:25 +08:00
# Users service
Users service provides an HTTP API for managing users. Through this API clients
2018-05-11 05:53:25 +08:00
are able to do the following actions:
- register new accounts
- obtain access tokens
- verify access tokens
For in-depth explanation of the aforementioned scenarios, as well as thorough
understanding of Mainflux, please check out the [official documentation][doc].
## Configuration
The service is configured using the environment variables presented in the
following table. Note that any unset variables will be replaced with their
default values.
2019-07-18 21:01:09 +08:00
| Variable | Description | Default |
|---------------------------|-------------------------------------------------------------------------|----------------|
| MF_USERS_LOG_LEVEL | Log level for Users (debug, info, warn, error) | error |
| MF_USERS_DB_HOST | Database host address | localhost |
| MF_USERS_DB_PORT | Database host port | 5432 |
| MF_USERS_DB_USER | Database user | mainflux |
| MF_USERS_DB_PASSWORD | Database password | mainflux |
| MF_USERS_DB | Name of the database used by the service | users |
| MF_USERS_DB_SSL_MODE | Database connection SSL mode (disable, require, verify-ca, verify-full) | disable |
| MF_USERS_DB_SSL_CERT | Path to the PEM encoded certificate file | |
| MF_USERS_DB_SSL_KEY | Path to the PEM encoded key file | |
| MF_USERS_DB_SSL_ROOT_CERT | Path to the PEM encoded root certificate file | |
| MF_USERS_HTTP_PORT | Users service HTTP port | 8180 |
| MF_USERS_SERVER_CERT | Path to server certificate in pem format | |
| MF_USERS_SERVER_KEY | Path to server key in pem format | |
NOISSUE - Add user groups (#1228) * adding group Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding user group Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding group Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add groups Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add groups Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add retrieve methods Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default admin user Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default admin user Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding endpoints Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding endpoints Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * changes signature for AssignUser Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * bug fixing retrieving groups Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove unused code Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * bug fixing retrieving groups Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * retrieve groups Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change environment for admin Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change environment for admin Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * retrieve groups Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove adding default group Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * expose port for debugging purposes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests, and linter errors Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add prefix Users for groups endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix linter problems Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix endpoint prefix url Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix endpoint test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add group features in cli Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove println Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * when user is created return id in response Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * when user is created return id in response Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding default admin env Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * proper alignment Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * proper alignment Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * rename method Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * return user id when created Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * return user id when created Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove unused variable Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * rename methods Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix to retrieve whole tree starting from parent Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add endpoint to list groups for user Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add readme for groups Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fixing bugs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fixing bugs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add group commands for add and remove user Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * replace default email, use example.com Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix capital letters beginning of sentence Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove warning for deprecated api, mistakenly copied Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * simplify repo methods, rely on db driver rather than the check before operation Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * check if group is valid Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * openapi spec 3.0 Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove check for existing users in groups before delete Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * renaming methods Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * renaming methods Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * renaming methods Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change func signature Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change func signature Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix bugs, resolve comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix bugs, resolve comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix alignment Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add missing command Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize envs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix doc Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix compile Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize cli commands Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * minor corrections Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * renaming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * renaming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * renaming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * rename methods Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix naming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * renaming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * renaming Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * resolve comments, minor changes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2020-09-24 05:18:53 +08:00
| MF_USERS_ADMIN_EMAIL | Default user, created on startup | |
| MF_USERS_ADMIN_PASSWORD | Default user password, created on startup | |
2019-07-18 21:01:09 +08:00
| MF_JAEGER_URL | Jaeger server URL | localhost:6831 |
MF-532 - Password reset (#873) * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default value for metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default value for metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default value for metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default value for metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default value for metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default value for metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * when metadata is not set dont save 'null' string Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * when metadata is not set dont save 'null' string Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * when metadata is not set dont save 'null' string Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change metadata type, add error handling Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change metadata type, add error handling Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change metadata type, add error handling Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove extra char Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove extra char Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove extra char Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * few small fixes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * few small fixes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * few small fixes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix identityRes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix identityRes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix identityRes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * mail Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * mail Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reset request endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reset request endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reset request endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add token Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add token Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add token Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add token methods Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add token methods Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add token methods Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding token endpoints Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding token endpoints Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding token endpoints Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding reset passw endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding reset passw endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding reset passw endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add logic for token verifying Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add logic for token verifying Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add logic for token verifying Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove mail from main Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove mail from main Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove mail from main Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * token and passwd update logic Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * token and passwd update logic Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * token and passwd update logic Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize mailing code Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add comments for password reset flow Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add comments for password reset flow Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change struct members to private Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small changes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small changes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small changes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add space Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add space Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add space Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert back changes used for testing Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert back changes used for testing Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert back changes used for testing Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize endpoints, extract host for link from Referer Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize endpoints, extract host for link from Referer Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding swagger docs for reset passw Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding swagger docs for reset passw Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix imports and some typos Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix imports and some typos Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding swagger docs for reset passw Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize endpoints, extract host for link from Referer Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize endpoints, extract host for link from Referer Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * addint test and update swagger for pass reset Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * addint test and update swagger for pass reset Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * addint test and update swagger for pass reset Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding test for endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding test for endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding test for endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding test for endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding endpoint test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding endpoint test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding endpoint test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change token generation Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change token generation Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change token generation Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize and change token gen Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize and change token gen Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize and change token gen Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * addint token and mail Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding token env Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding token env Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix error reporting Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix some comments and update readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix some comments and update readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix some comments and update readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix problmes due merge Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix problmes due merge Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix typos Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix typos Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add trusted certificates Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add endpoint for password change of currently authenticated user Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add env variable for conf reset endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default value for metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default value for metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * when metadata is not set dont save 'null' string Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change metadata type, add error handling Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove extra char Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * few small fixes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix identityRes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reset request endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding token endpoints Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding reset passw endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add logic for token verifying Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove mail from main Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small changes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add space Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert back changes used for testing Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize endpoints, extract host for link from Referer Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize endpoints, extract host for link from Referer Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * addint test and update swagger for pass reset Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding endpoint test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix some comments and update readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add env variable for conf reset endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * resolving some style comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * minor fixes due to bad merge Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix problem with unsigned commits Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix problem with unsigned commits Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix call to users.New Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix call to users.New Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * rename file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * rename to email.go Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * additional comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * additional comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor email util Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor email util Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor email util Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor email util Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove debug bin Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add driver conf for mail Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor email Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor email Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix failing tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add testify Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small fix Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add token conf Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small fix Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small fix Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * configurable email template Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix missing var Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add env for email template file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add env for email template file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert to master Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove dev container Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small fixes, typos, namings Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix typo Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * resolving comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * resolving comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * resolving comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * resolving comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * resolving comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * return err from email New() Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change MF_TOKEN_RESET_ENDPOINT Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add and remove env vars Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * separate password logic into two methods Change and Reset Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove blank line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update docs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * dont use camel case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small fix Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize email template for passw reset Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize email template for passw reset Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-10-22 20:53:14 +08:00
| MF_EMAIL_DRIVER | Mail server driver, mail server for sending reset password token | smtp |
| MF_EMAIL_HOST | Mail server host | localhost |
| MF_EMAIL_PORT | Mail server port | 25 |
| MF_EMAIL_USERNAME | Mail server username | |
| MF_EMAIL_PASSWORD | Mail server password | |
| MF_EMAIL_FROM_ADDRESS | Email "from" address | |
| MF_EMAIL_FROM_NAME | Email "from" name | |
| MF_EMAIL_TEMPLATE | Email template for sending emails with password reset link | email.tmpl |
MF-532 - Password reset (#873) * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default value for metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default value for metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default value for metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default value for metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default value for metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default value for metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * when metadata is not set dont save 'null' string Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * when metadata is not set dont save 'null' string Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * when metadata is not set dont save 'null' string Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change metadata type, add error handling Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change metadata type, add error handling Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change metadata type, add error handling Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove extra char Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove extra char Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove extra char Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * few small fixes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * few small fixes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * few small fixes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix identityRes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix identityRes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix identityRes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * mail Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * mail Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reset request endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reset request endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reset request endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add token Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add token Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add token Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add token methods Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add token methods Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add token methods Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding token endpoints Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding token endpoints Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding token endpoints Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding reset passw endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding reset passw endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding reset passw endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add logic for token verifying Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add logic for token verifying Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add logic for token verifying Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove mail from main Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove mail from main Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove mail from main Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * token and passwd update logic Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * token and passwd update logic Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * token and passwd update logic Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize mailing code Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add comments for password reset flow Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add comments for password reset flow Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change struct members to private Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small changes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small changes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small changes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add space Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add space Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add space Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert back changes used for testing Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert back changes used for testing Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert back changes used for testing Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize endpoints, extract host for link from Referer Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize endpoints, extract host for link from Referer Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding swagger docs for reset passw Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding swagger docs for reset passw Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix imports and some typos Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix imports and some typos Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding swagger docs for reset passw Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize endpoints, extract host for link from Referer Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize endpoints, extract host for link from Referer Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * addint test and update swagger for pass reset Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * addint test and update swagger for pass reset Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * addint test and update swagger for pass reset Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding test for endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding test for endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding test for endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding test for endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding endpoint test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding endpoint test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding endpoint test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change token generation Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change token generation Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change token generation Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize and change token gen Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize and change token gen Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize and change token gen Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * addint token and mail Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding token env Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding token env Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix error reporting Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix some comments and update readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix some comments and update readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix some comments and update readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix problmes due merge Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix problmes due merge Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix typos Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix typos Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add trusted certificates Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add endpoint for password change of currently authenticated user Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add env variable for conf reset endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add metadata to users Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default value for metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add default value for metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * when metadata is not set dont save 'null' string Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change metadata type, add error handling Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove extra char Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * few small fixes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix identityRes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add users metadata Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * password reset, sketching Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reset request endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding token endpoints Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding reset passw endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add logic for token verifying Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove mail from main Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small changes Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add space Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert back changes used for testing Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize endpoints, extract host for link from Referer Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize endpoints, extract host for link from Referer Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * addint test and update swagger for pass reset Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * adding endpoint test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix some comments and update readme Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add env variable for conf reset endpoint Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * resolving some style comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * minor fixes due to bad merge Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix problem with unsigned commits Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix problem with unsigned commits Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix call to users.New Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix call to users.New Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * rename file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * rename to email.go Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * additional comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * additional comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor email util Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor email util Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor email util Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor email util Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove debug bin Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add driver conf for mail Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor email Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * refactor email Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix failing tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add testify Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small fix Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add token conf Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small fix Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small fix Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * configurable email template Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix missing var Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add env for email template file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add env for email template file Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix tests Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * revert to master Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove dev container Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small fixes, typos, namings Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix typo Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * resolving comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * resolving comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * resolving comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * resolving comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * resolving comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * return err from email New() Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * change MF_TOKEN_RESET_ENDPOINT Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * add and remove env vars Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * separate password logic into two methods Change and Reset Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update comments Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * remove blank line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * update docs Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * dont use camel case Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * small fix Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize email template for passw reset Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * reorganize email template for passw reset Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
2019-10-22 20:53:14 +08:00
| MF_TOKEN_RESET_ENDPOINT | Password request reset endpoint, for constructing link | /reset-request |
2018-05-11 05:53:25 +08:00
## Deployment
The service itself is distributed as Docker container. Check the [`users`](https://github.com/mainflux/mainflux/blob/master/docker/docker-compose.yml#L109-L143) service section in
docker-compose to see how service is deployed.
2018-05-11 05:53:25 +08:00
To start the service outside of the container, execute the following shell script:
```bash
# download the latest version of the service
git clone https://github.com/mainflux/mainflux
2018-05-11 05:53:25 +08:00
cd mainflux
2018-05-11 05:53:25 +08:00
# compile the service
2018-05-11 05:53:25 +08:00
make users
# copy binary to bin
make install
# set the environment variables and run the service
MF_USERS_LOG_LEVEL=[Users log level] \
MF_USERS_DB_HOST=[Database host address] \
MF_USERS_DB_PORT=[Database host port] \
MF_USERS_DB_USER=[Database user] \
MF_USERS_DB_PASS=[Database password] \
MF_USERS_DB=[Name of the database used by the service] \
MF_USERS_DB_SSL_MODE=[SSL mode to connect to the database with] \
MF_USERS_DB_SSL_CERT=[Path to the PEM encoded certificate file] \
MF_USERS_DB_SSL_KEY=[Path to the PEM encoded key file] \
MF_USERS_DB_SSL_ROOT_CERT=[Path to the PEM encoded root certificate file] \
MF_USERS_HTTP_PORT=[Service HTTP port] \
MF_USERS_SERVER_CERT=[Path to server certificate] \
MF_USERS_SERVER_KEY=[Path to server key] \
MF_JAEGER_URL=[Jaeger server URL] \
MF_EMAIL_DRIVER=[Mail server driver smtp] \
MF_EMAIL_HOST=[Mail server host] \
MF_EMAIL_PORT=[Mail server port] \
MF_EMAIL_USERNAME=[Mail server username] \
MF_EMAIL_PASSWORD=[Mail server password] \
MF_EMAIL_FROM_ADDRESS=[Email from address] \
MF_EMAIL_FROM_NAME=[Email from name] \
MF_EMAIL_TEMPLATE=[Email template file] \
MF_TOKEN_RESET_ENDPOINT=[Password reset token endpoint] \
$GOBIN/mainflux-users
2018-05-11 05:53:25 +08:00
```
If `MF_EMAIL_TEMPLATE` doesn't point to any file service will function but password reset functionality will not work.
2018-05-11 05:53:25 +08:00
## Usage
For more information about service capabilities and its usage, please check out
the [API documentation](openapi.yml).
2018-05-11 05:53:25 +08:00
[doc]: http://mainflux.readthedocs.io