Carl Bergquist
4710566514
bus: add ctx for all signed in user queries ( #33970 )
...
Signed-off-by: bergquist <carl.bergquist@gmail.com >
2021-05-18 18:24:42 +02:00
idafurjes
f2fcf721eb
32540: Add org users with pagination ( #33788 )
...
* Add model for search org user and add handler for dispatch
* 32540_org_users_with_pagination: Add endpoint for search org users
* 32540_org_users_with_pagination: Add test for org user search handler
* 32540_org_users_with_pagination: fix indentation
* 32540_org_users_with_pagination: Remove newline
* 32540_org_users_with_pagination: Remove empty line
* 32540_org_users_with_pagination: Fix indentation
* Update pkg/api/org_users.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* Update pkg/api/org_users.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* Update pkg/models/org_user.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* Update pkg/api/org_users_test.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* Update pkg/api/org_users_test.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* 32540_org_users_with_pagination: Use hs.SQLStore.SearchOrgUsers instead of bus
* Add model for search org user and add handler for dispatch
* 32540_org_users_with_pagination: Add endpoint for search org users
* 32540_org_users_with_pagination: Add test for org user search handler
* 32540_org_users_with_pagination: fix indentation
* 32540_org_users_with_pagination: Remove newline
* 32540_org_users_with_pagination: Remove empty line
* 32540_org_users_with_pagination: Fix indentation
* Update pkg/api/org_users.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* Update pkg/api/org_users.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* Update pkg/models/org_user.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* Update pkg/api/org_users_test.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* Update pkg/api/org_users_test.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* 32540_org_users_with_pagination: Use hs.SQLStore.SearchOrgUsers instead of bus
* 32540_org_users_with_pagination: Add test for the sqlstore
* 32540_org_users_with_pagination: Fix sqlstore test
* Update pkg/api/org_users.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* Update pkg/api/org_users_test.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* Update pkg/api/org_users_test.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* Update pkg/services/sqlstore/org_users.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* Update pkg/services/sqlstore/org_users.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* Update pkg/services/sqlstore/org_test.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* Update pkg/services/sqlstore/org_test.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* 32540: Fix search org users method
* 32540: Fix sqlstore test
* 32540: Fix go-lint
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
2021-05-12 14:10:35 +02:00
Dafydd
0dcd0281ab
Chore: avoid hard-coding IDs in integration tests ( #33152 )
...
* use dynamic user Ids in test
* use dynamic IDs in alert tests
* use dynamic IDs in dashboard test queries
* use dynamic IDs in org test queries
2021-04-21 11:22:46 +03:00
Arve Knudsen
87c3a2b790
PluginManager: Make Plugins, Renderer and DataSources non-global ( #31866 )
...
* PluginManager: Make Plugins and DataSources non-global
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix integration tests
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Replace outdated command
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* DashboardService: Ensure it gets constructed with necessary parameters
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix build
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* DashboardService: Ensure it gets constructed with necessary parameters
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Remove dead code
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix test
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix test
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Remove FocusConvey
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix test
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Remove dead code
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Undo interface changes
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Backend: Move tsdbifaces.RequestHandler to plugins.DataRequestHandler
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Rename to DataSourceCount
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Consolidate dashboard interfaces into one
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix tests
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix tests
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix test
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix tests
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix tests
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix tests
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix tests
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix dashboard integration tests
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
2021-03-17 16:06:10 +01:00
Arve Knudsen
52c154a221
Backend: Rename variables for style conformance ( #29097 )
...
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
2020-11-17 17:09:14 +01:00
Emil Hessman
3519330166
Chore: Rewrite test helpers from GoConvey to stdlib ( #28919 )
2020-11-11 21:33:32 +01:00
Sofia Papagiannaki
4937f0daab
SQLStore: Run tests as integration tests ( #28265 )
...
* sqlstore: Run tests as integration tests
* Truncate database instead of re-creating it on each test
* Fix test description
See https://github.com/grafana/grafana/pull/12129
* Fix lint issues
* Fix postgres dialect after review suggestion
* Rename and document functions after review suggestion
* Add periods
* Fix auto-increment value for mysql dialect
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com >
2020-10-16 10:46:14 +03:00
Benjamin Blattberg
3403db190d
API: Support paging in the admin orgs list API ( #26932 )
...
* Add page/limit to org search
* Update docs
* Fix test per PR feedback
2020-08-12 10:59:07 +03:00
Arve Knudsen
41d432b5ae
Chore: Enable whitespace linter ( #25903 )
...
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
2020-07-06 20:17:28 +02:00
Arve Knudsen
084542a006
Chore: Consolidate on golangci-lint ( #25834 )
...
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
2020-06-26 08:46:08 +02:00
Carl Bergquist
f9962eabff
chore: avoid aliasing imports in services ( #22499 )
2020-02-29 13:35:15 +01:00
Arve Knudsen
2a78d2a61c
pkg/services: Check errors ( #19712 )
...
* pkg/services: Check errors
* pkg/services: Don't treat context.Canceled|context.DeadlineExceeded as error
2019-10-22 14:08:18 +02:00
gotjosh
0cbbb43222
LDAP: Add API endpoint to debug user mapping from LDAP ( #18833 )
...
* Move the ReloadLDAPCfg function to the debug file
Appears to be a better suite place for this.
* LDAP: Return the server information when we find a specific user
We allow you to specify multiple LDAP servers as part of LDAP authentication integration. As part of searching for specific users, we need to understand from which server they come from. Returning the server configuration as part of the search will help us do two things:
- Understand in which server we found the user
- Have access the groups specified as part of the server configuration
* LDAP: Adds the /api/admin/ldap/:username endpoint
This endpoint returns a user found within the configured LDAP server(s). Moreso, it provides the mapping information for the user to help administrators understand how the users would be created within Grafana based on the current configuration.
No changes are executed or saved to the database, this is all an in-memory representation of how the final result would look like.
2019-09-03 18:34:44 +01:00
Mario Trangoni
fadd816d89
pkg/*: Fix misspell issues
...
See,
$ find . -type f | xargs misspell -locale US | grep -vi -e vendor -e devenv -e Unknwon -e Destory | grep pkg
./pkg/services/sqlstore/org_test.go:190:15: "frome" is a misspelling of "from"
./pkg/tsdb/elasticsearch/response_parser.go:544:24: "Unkown" is a misspelling of "Unknown"
./pkg/tsdb/opentsdb/opentsdb.go:87:20: "marshalling" is a misspelling of "marshaling"
./pkg/components/dynmap/dynmap_test.go:2:7: "Licence" is a misspelling of "License"
./pkg/components/dynmap/dynmap.go:2:7: "Licence" is a misspelling of "License"
2018-12-04 23:29:34 +01:00
Torkel Ödegaard
b671b9704f
changed property name to UserWasDeleted and added an assert for it
2018-10-11 12:20:53 -07:00
Torkel Ödegaard
5b5cb6622d
Remove user form org now completely removes the user from the system if the user is orphaned
2018-10-11 07:48:35 +02:00
Mark Meyer
0f6e5e2953
Allow settting of default org id to auto-assign to ( #12401 )
...
Author: Mark Meyer <mark@ofosos.org >
2018-07-13 12:14:40 -07:00
Marcus Efraimsson
004142a1e4
Merge pull request #12263 from grafana/11076_current_org
...
Set current org when adding/removing user to org
2018-06-18 11:19:42 +02:00
Marcus Efraimsson
6d48d0a80c
set current org when adding/removing user to org
...
To not get into a situation where a user has a current organization assign which he is
not a member of we try to always make sure that a user has a valid current organization
assigned.
2018-06-18 09:30:01 +02:00
bergquist
1181e96799
merge create user handlers
2018-06-15 21:23:57 +02:00
Daniel Lee
5a3ba68a9c
database: fixes after xorm update
2018-03-16 00:09:29 +01:00
Torkel Ödegaard
fcaa8227a6
Dashboard acl query fixes ( #10909 )
...
* initial fixes for dashboard permission acl list query, fixes #10864
* permissions: refactoring of acl api and query
2018-02-14 15:04:26 +01:00
Marcus Efraimsson
a86f2fa34b
user picker should only include users from current org ( #10845 )
2018-02-09 10:42:37 +01:00
Torkel Ödegaard
9c6c8c0f3f
acl fixes
2017-06-22 17:10:43 -04:00
Torkel Ödegaard
fcc8557dbb
dashboard acl work
2017-06-21 14:11:16 -04:00
Torkel Ödegaard
c4a1803060
refactoring more renaming
2017-06-19 17:30:54 -04:00
Torkel Ödegaard
e0b9ba7554
refactoring renaming dashboard folder operations
2017-06-19 17:15:25 -04:00
Torkel Ödegaard
cbbbccf12a
refactoring dashoard folder guardian
2017-06-17 18:24:38 -04:00
Daniel Lee
9e7aa65fb7
WIP: clean up after user and org user delete
2017-06-15 20:19:54 +02:00
Daniel Lee
193d468ed3
admin: adds paging to global user list
...
Currently there is a limit of 1000 users in the global
user list. This change introduces paging so that an
admin can see all users and not just the first 1000.
Adds a new route to the api - /api/users/search that
returns a list of users and a total count. It takes
two parameters perpage and page that enable paging.
Fixes #7469
2017-02-13 12:59:36 +01:00
Torkel Ödegaard
a8aab0cb2b
Worked on user administration page, a grafana server admin can now add and edit organization roles for any user, #2014
2015-05-19 11:47:14 +02:00
Torkel Ödegaard
cb8110cd48
Refactoring, worked on middleware unit tests, and began thinking about api unit tests, #1921
2015-05-01 16:23:36 +02:00
Torkel Ödegaard
e771d8e944
Organization: You can now update the organization user role directly (without removing and readding the organization user). Closes #1899
2015-05-01 09:48:07 +02:00
Torkel Ödegaard
f3d4d2782f
Simplified single org settings, now auto_assign_org, and auto_assign_org_role, new [users] config section, Closes #1585
2015-03-11 16:19:29 +01:00
Torkel Ödegaard
04ca85fe89
Moved dashboard theme option from the dashboard to a persisted user setting, #1458
2015-02-28 14:30:08 +01:00
Torkel Ödegaard
da41d99aa7
Fixed sql integration test
2015-02-23 20:48:43 +01:00
Torkel Ödegaard
26e4809e2e
Big Backend Refatoring: Renamed Account -> Org
2015-02-23 20:07:49 +01:00