summaryrefslogtreecommitdiffstats
path: root/api4/user_test.go
Commit message (Collapse)AuthorAgeFilesLines
* MM-12234: configurable limit to user autocomplete and search matches (#9499)Jesse Hallam2018-10-171-22/+22
| | | | | | | | | | * unit test cleanup * allow limiting user search results * clean up test users before starting * model UserSearchOptions to simplify parameters
* Refactored to rename "service terms" to "terms of service" (#9581)Harshil Sharma2018-10-091-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * #124 renamed identififers from service terms to terms of service * #124 renamed identififers from service terms to terms of service * 124 renamed ServiceTerms model to TermsOfService * 124 Renamed EnableCustomServiceTerms feature flag to EnableCustomTermsOfService * 124 Renamed EnableCustomServiceTerms feature flag to EnableCustomTermsOfService * #124 fixed formatting * #124 fixed formatting * #132 renamed table ServiceTerms to TermsOfService * #124 renamed some missed files from 'service_terms' to 'terms_of_service' * #124 removed fixed TODOs * drop migrate of ServiceTerms table, since backporting * s/ServiceTerms/TermsOfService/ in tests * s/AcceptedServiceTermsId/AcceptedTermsOfServiceId/ Change the model attribute, even though the column name will eventually be removed. * s/accepted_service_terms_id/accepted_terms_of_service_id/ to match redux * s/serviceTerms/termsOfService * rename column too, and add max size constraint * s/EnableCustomServiceTerms/EnableCustomTermsOfService
* MM-12519: simplify autocomplete team id checking (#9577)Jesse Hallam2018-10-091-2/+2
| | | This handles clients sending a team id in a direct message or group channel autocomplete, when it necessarily won't match. Just verify that the user has permission for the team in question, whenever it is provided.
* MM-12067: Add SetDefaultProfileImage to reset the user profile image to a ↵Jesús Espino2018-10-021-0/+44
| | | | | | | | | | | | generated one (#9449) * MM-12067: Add SetDefaultProfileImage to reset the user profile image to a generated one * Allow to get the default profile image for my user * Allowing to reset the last update image date to 0 * PR reviews
* MM-12192: autocompleteUsers: if a teamId is provided, require it to match ↵Jesse Hallam2018-09-281-0/+5
| | | | | | | | the channel's team id (#9481) * MM-12192: unit test * MM-1292: autocompleteUsers: if a teamId is provided, require it to match the channel's team id
* #MM-12130 changes for custom service terms (#9450)Harshil Sharma2018-09-261-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * #MM-12130 changes for custom service terms * Fixed styling * Added getServiceTerms API * removed unnecessary panic * removed custom service terms text from flat config * reverted user sql store as those changes are no longer needed * added tests * Updated a config key to be more standard * Added copyright info * Loading service terms only if the feature is enabled * Loading service terms only if the feature is enabled * removed unused index * added createservice termns API * made a param to bool instead of string * added createservice termns API * review fixes * fixed styling * Minor refactoring * removed saveConfig and loadConfig magic * added empty service terms text check to createServiceTerms API * refactoed some urls to be terms_of_service instead of service_terms * removed check for support settings * changed URLs in tests * removed unused code * fixed a bug * added service termd id in conif * fixed a test * review fixes * minor fixes * Fixed TestCreateServiceTerms
* add translation strings and add test case (#9294)Carlos Tadeu Panato Junior2018-09-241-0/+5
|
* Move file backend to its own service (#9435)Jesús Espino2018-09-201-5/+5
| | | | | | * Move file backend to its own service * Moving utils/inbucket to mailservice package
* add megacheck as makefile target (#9288)Daniel Schalla2018-09-031-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Fix code issues in channel_test.go Fix Channel Test Issues detected by Megacheck Fix API Emoji Test Issues detected by Megacheck Fixed API Issues Reported by Megacheck Fixed App issues reported by megacheck Remaining fixes removed test added by mistake from old HEAD gofmt Store Fixes simplified returns Fix test for multi member channel delete revert to delete unused function
* Idiomatic error handling on team sql store (#9201)Jesús Espino2018-08-031-2/+2
|
* MM-10254 Add plugin APIs for getting/updating user statuses (#9101)Joram Wilander2018-07-161-1/+1
| | | | | | | | * Add plugin APIs for getting/updating user statuses * Add and update tests * Updates per feedback
* Restore config after finisht the test case (#9085)Carlos Tadeu Panato Junior2018-07-111-3/+61
|
* MM-10980: Conditionally filteres User json properties. (#9018)Martin Kraft2018-06-291-1/+7
|
* Prototype for CBA (#8475)Corey Hulen2018-06-121-0/+52
| | | | | | | | | | | | | | * Prototype for CBA * Fixing gofmt issues * Do not require password if logging in with certificate * Fixing issues from feedback * Adding unit tests * Fixing feedback
* Relese5.0 merge master 20180608 (#8933)Carlos Tadeu Panato Junior2018-06-081-48/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add missing diagnostics (#8911) * Update diagnostics.go * Update diagnostics.go * Fix push notification styling backwards compatibility (#8913) * MM-10803: remove premature user sanitization on deactivation (#8926) * remove unused UpdateNonSSOUserActive * MM-10803: stop prematurely sanitizing users on deactivate This change was preceded by the removal of UpdateNonSSOUserActive to ensure there are no APIs relying on the sanitized return value. * MM-10803: test websocket events after UpdateUserActive * MM-10264: Adds system scheme to permissions import/export. (#8924) * MM-10264: Adds system scheme to permissions import/export. * MM-10264: Switches to more likely unique name. * MM-10264: Changed collision prevention string. * MM-10264: Rolls back created schemes in all error cases. * MM-10264: Test fix for more rollback cases.
* Get the count of the all system users at endpoint /users/stats (#8847)lisakycho2018-06-071-20/+15
| | | | | | | | * Get the count of the all system users at endpoint /users/stats * Added GetTotalUsersStats test in api4 * Changed pluralization and added the test back.
* [MM-1915] Add Deactivate Account - server side (#8699)Carlos Tadeu Panato Junior2018-05-281-0/+15
|
* MM-10640 Set EnableUserCreation to true by default (#8815)Balasankar C2018-05-181-5/+5
| | | | | | | | | | | | | | * Set EnableUserCreation to true by default * Fix argument type to FormatBool * Convert EnableUserCreation instances to pointer * Convert to boolean in tests also * Set value of pointer to be false * Convert remaining EnableUserCreation instances to pointer
* MM-9779: Incorporate a Token into the invitations system (#8604)Jesús Espino2018-04-181-73/+64
| | | | | | | | | | | | | | | | | | | | * Incorporate a Token into the invitations system * Adding unit tests * Fixing some api4 client tests * Removing unnecesary hash validation * Change the Hash concept on invitations with tokenId * Not send invitation if it wasn't able to create the Token * Fixing some naming problems * Changing the hash query params received from the client side * Removed unneded data param in the token usage
* Fix error handling when requesting profile image for bad user ID (#8618)Joram Wilander2018-04-131-0/+3
|
* Timezone feature (#8185)Chris Duarte2018-03-221-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add supported timezones into config Remove Timezone list creation in favor of timezone from configs Add Timezone field to Users table Clean up format of SupportedTimezones in config * Remove unwanted change * Add test for updating user timezone * Add empty map[string]string if Timezone is null * Add EnableTimezoneSelection config * Revert back to map[string]string for ClientConfig * Refactor SupportedTimezones into timezones.json * Include timezones.json in TestConfigFlag * Add timezone api endpoint * Bump varchar size to 256 and setMaxSize in user_store * Refactor LoadConfig to LoadConfig and LoadTimezoneConfig * Remove unnecessary argument in LoadConfig, mail_test * Add test for timezone endpoint * Add license header * Refactor timezones endpoint to system.go * Add system base route to timezone endpoint * db timezone upgrade in db v4.9 * Avoid saving SupportedTimezones to config.json * Add timezonePath support in config * Remove EnableTimezoneSelection from config * Use return statement without return parameter * Refactor test for SupportedTimezones * Check for supportedTimezone != nil instead of using len * Decouple SupportedTimezones out of Config * Fix failing test * Add LastTeamIconUpdate back in upgrade.go * Write timezone config in config_flag_test * Add code fallback for default timezone support
* MM-9274- Sort Users in Channel by status (#8181)Stephen Kiers2018-03-091-0/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sort by lastActivity * added status ordering to Users * sort offline before dnd * remove data not needed * added seperate call for when order=‘status’ is on GetUser request * remove PrintLn * styling fix * remove mistake * mistake 2 * better comment * explicit if statemnt * writing tests * removed manually added mocks * generated mock * ICU-668 Added unit tests * style fix * sort by lastActivity * added status ordering to Users * sort offline before dnd * remove data not needed * added seperate call for when order=‘status’ is on GetUser request * remove PrintLn * styling fix * remove mistake * mistake 2 * better comment * explicit if statemnt * writing tests * removed manually added mocks * generated mock * ICU-668 Added unit tests * style fix * reverse dnd and offline * Fixed app.SaveStatusAndBroadcast * Fixed incorrect merge * Fixing incorrect merge again
* Eliminate utils.SetLicense calls (#8217)Chris2018-02-071-49/+4
| | | | | | | | | | * eliminate utils.SetLicense calls * test fix * another test fix * more test fixes
* Finally remove utils.Cfg (#8113)Chris2018-01-171-44/+40
| | | | | | | | * finally remove utils.Cfg * fix compile error * another test compilation fix
* [PLT-7793] Add /users/tokens/search endpoint (#8088)Adrian Carolli2018-01-111-0/+46
| | | | | | | | * Add /users/tokens/search endpoint + tests * Fix check-style * Unnecessary deletion
* [PLT-7793] Added /users/tokens endpoint (#8038)Adrian Carolli2018-01-051-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added /users/tokens/all endpoint - UserAccessStore now has getAll method - Added tests - Added route - Added handler * Remove space fix check-style * Remove blank space check-style * Fixes for make check-style * Remove extra code that is un-needed in user_test.go * Rename endpoint + grammar - Renamed /users/tokens/all to /users/tokens - Renamed getUserAccessTokens to getUserAccessTokensForUser - Renamed getAllUserAccessTokens to getUserAccessTokens - Minor Grammar changes * Add localization for sql_user_access_token.get_all * Fix minor plural spelling
* Add admin update endpoint that can update authservice and authdata (#7842)Chris Duarte2018-01-041-0/+63
| | | | | | | | | | * add admin update endpoint that can upate authservice and authdata * Control only SystemAdmin access * Refactored AdminUpdate endpoint to only be able to update AuthData, AuthService and Password by User.Id * Refactor to move `PUT /api/v4/users/{user_id}/auth`. Created a struct to hold UserAuth info.
* Allow deactivation of SSO users (#7952)Joram Wilander2017-12-081-1/+10
|
* Add Config to disable Auth Transfers. (#7843)Chris Duarte2017-11-281-0/+51
| | | | | | * Add Config to disable Auth Transfers. * Set config ExperimentalEnableAuthenticationTransfer behind an E20 license restriction
* Role refactor (#7867)Chris2017-11-211-33/+33
| | | | | | | | * role refactor * add missing file * fix web test
* more global config ref cleanup (#7802)Chris2017-11-091-12/+8
|
* prevent deactivation of sso users (#7759)Chris2017-11-021-2/+2
|
* PLT-7978 Add websocket event for user role update (#7745)Joram Wilander2017-10-311-7/+7
| | | | | | | | * Add websocket event for user role update * Fix tests * More test fixes
* simplify things (#7735)Chris2017-10-301-3/+3
|
* Remove more global refs / state (#7723)Chris2017-10-261-6/+5
| | | | | | | | | | * remove more global refs / state * fix job enterprise initialization * fix api4 test compilation * saml api endpoints fix
* eliminate more utils.Cfg references (#7701)Chris2017-10-241-26/+0
|
* add model.NewX funcs for builtin types (#7692)Chris2017-10-231-10/+5
| | | | | | * add model.NewX funcs for builtin types * whoops, forgot to add the new file
* Reduce cfg boilerplate (#7689)Chris2017-10-231-78/+4
| | | | | | | | | | | | * reduce cfg boilerplate * fix compile error * user test fix * another test fix * simplify diagnostics / testing
* Expose user.Props through REST API (#7661)Joram Wilander2017-10-201-1/+7
|
* [PLT-7794] Add user access token enable/disable endpoints (#7630)Nick Frazier2017-10-191-1/+97
| | | | | | | | | | | | * Add column to UserAccessTokens table * PLT-7794 Add user access token enable/disable endpoints * replaced eliminated global variable * updates to user_access_token_store and upgrade.go * style fix and cleanup
* Reduce utils.Cfg references (#7650)Chris2017-10-181-83/+83
| | | | | | | | | | | | * app.UpdateConfig method * test fix * another test fix * the config override option as-was is just error prone, remove it for now * derp
* [PLT-7396] Add the ability to revoke user sessions in System Console > Users ↵Rick Batka2017-10-161-0/+45
| | | | | | | | #7493 (#7623) * add endpoint and tests for revoking all sessions for a user * fix failing test build
* PLT-7781 Some more OAuth fixes (#7568)Joram Wilander2017-10-041-23/+83
| | | | | | * Some other oauth fixes * Fix unit test
* Updates to session revoking in v4 (#7565)Joram Wilander2017-10-041-0/+8
|
* Don't use global app for api / api4 tests (#7528)Chris2017-10-021-40/+50
| | | | | | | | | | | | | | * don't use global app for api / api4 tests * put sleep back. we're gonna have to do some goroutine wrangling * fix oauth test config assumptions * jobs package, i'm comin' for you next * app test fix * try increasing sleep a little
* Fixing profile image tag (#7435)Corey Hulen2017-09-191-2/+2
| | | | | | | | * Fixing profile image tag * Fixing unit test * Fixing unit test
* Renaming repoChristopher Speller2017-09-061-2/+2
|
* Adding jenkinsfile for new build server.Christopher Speller2017-09-061-5/+4
|
* app type transition (#7167)Chris2017-09-061-18/+17
|
* Fix setting profile image for other users (#7306)Joram Wilander2017-08-311-0/+9
|