Commit Graph

1087 Commits

Author SHA1 Message Date
Jo
d6c468c1c2
Auth: Add empty role definition (#64694)
* Allow setting role as None

Co-authored-by: gamab <gabi.mabs@gmail.com>

Seeking for places where role.None would be used

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

Adding None role to the frontend

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

unify org role declaration and remove from add permission

fix backend test

fix backend lint

* remove role none from frontend

* Simplify checks

Co-authored-by: Kalle Persson <kalle.persson@grafana.com>

* nits

---------

Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
2023-07-06 15:40:06 +02:00
Karl Persson
382b24742a
Auth: Add feature flag to move token rotation to client (#65060)
* FeatureToggle: Add toggle to use a new way of rotating tokens

* API: Add endpoints to perform token rotation, one endpoint for api request and one endpoint for redirectsd

* Auth: Aling not authorized handling between auth middleware and access
control middleware

* API: add utility function to get redirect for login

* API: Handle token rotation redirect for login page

* Frontend: Add job scheduling for token rotation and make call to token rotation as fallback in retry request

* ContextHandler: Prevent in-request rotation if feature flag is enabled and check if token needs to be rotated

* AuthN: Prevent in-request rotation if feature flag is enabled and check if token needs to be rotated

* Cookies: Add option NotHttpOnly

* AuthToken: Add helper function to get next rotation time and another function to check if token need to be rotated

* AuthN: Add function to delete session cookie and set expiry cookie

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2023-03-23 14:39:04 +01:00
idafurjes
2c50c44d89
Chore: Move library elements models to library elements service (#62507)
* Chore: Move library elements models to library elements service

* Fix stat import

* Fix faulty error assignment
2023-02-01 17:32:05 +01:00
idafurjes
cbc10f9c5d
Chore: Delete password and search from models package (#62482)
* Chore: Delete password and search from models package

* Rename model to AdminCreateUserResponse
2023-01-31 11:04:55 +01:00
Kristin Laemmert
9256a520a4
chore: move user_auth models to (mostly) login service (#62269)
* chore: move user_auth models to (mostly) login service
2023-01-27 13:36:54 -05:00
Eric Leijonmarck
5531e22f46
Auth: Add disable of team sync for JWT Authentication (#62191)
* fix: disable team sync for JWT Authentication

* add: comment to test

* change test to conform to new expected behavior

* fix: spelling

* formatting
2023-01-27 16:05:25 +01:00
idafurjes
6c5a573772
Chore: Move ReqContext to contexthandler service (#62102)
* Chore: Move ReqContext to contexthandler service

* Rename package to contextmodel

* Generate ngalert files

* Remove unused imports
2023-01-27 08:50:36 +01:00
Kristin Laemmert
e8b8a9e276
chore: move dashboard_acl models into dashboard service (#62151) 2023-01-26 08:46:30 -05:00
Karl Persson
94dca85b30
Auth: Fix error check (#62192) 2023-01-26 12:35:08 +00:00
Kristin Laemmert
dd147a3c31
chore: move entity models into entity store service (#62145) 2023-01-25 12:43:22 -05:00
idafurjes
421976e919
Chore: Remove folders from models pkg (#61853) 2023-01-25 09:14:32 +01:00
Kristin Laemmert
fe27acc3a9
chore: move validations model into the validations service (#61953) 2023-01-23 15:10:14 -05:00
Kristin Laemmert
6e9eb0d931
chore: move plugins models into pluginsettings svc (#61944) 2023-01-23 13:56:20 -05:00
Kristin Laemmert
857649e30b
chore: move models/licensing into licensing service (#61878) 2023-01-23 11:53:43 -05:00
Kristin Laemmert
40feee0d17
chore: move alert-related models (#61716)
* chore: move alert notification models into the alerting service (alerting/models)
2023-01-23 08:19:25 -05:00
Ryan McKinley
624e5dbed2
EntityAPI: Save nested summary info in the SQL database (#61732) 2023-01-21 00:00:17 +00:00
Kristin Laemmert
cd08f2575a
chore: move jwt models into auth/jwt (#61862)
* chore: move jwt models into auth/jwt
2023-01-20 13:11:06 -05:00
idafurjes
68445a7c77
Chore: Remove dashboard ACL from models (#61749)
* Remove dashboard ACL from models

* Remove unused comment
2023-01-20 14:58:47 +01:00
idafurjes
8cbcdf1c26
Remove live.go from models (#61742)
* Remove live.go from models

* Change Id to ID

* Add xorm tags
2023-01-19 18:10:40 +01:00
Karl Persson
1454b1b40a
Reqcontext: Add methods to write responses bases on errutil.Error (#60889)
* ReqContext: Add methods to reqcontext used to handle errutil.Error

* ReqContext: Pass all public field in response from errutil.Error
2023-01-18 14:29:23 +01:00
idafurjes
b573b19ca3
Chore: Remove dashboards from models pkg (#61578)
* Copy dashboard models to dashboard pkg

* Use some models from current pkg instead of models

* Adjust api pkg

* Adjust pkg services

* Fix lint

* Chore: Remove dashboards models

* Remove dashboards from models pkg

* Fix lint in tests

* Fix lint in tests 2

* Fix for import in auth

* Remove newline

* Revert unused fix
2023-01-18 13:52:41 +01:00
Kristin Laemmert
f6e3252c00
chore: move notifications models into notifications service (#61638) 2023-01-17 14:47:31 -05:00
Serge Zaitsev
efed0151f8
Chore: Remove pkg/models/stats.go (#61613)
* remove pkg/models/stats.go

* rename models package in tests
2023-01-17 14:17:54 +01:00
Jo
6fec8fda39
AuthN: Clean errors in user/org sync (#61560)
* clean errors in user/org sync

* lower logging level for non 5xx errors
2023-01-16 16:37:04 +00:00
Serge Zaitsev
7e51eac740
Chore: Remove unused models (#61533)
* Chore: Remove unused models

* put AuthModuleConversion back
2023-01-16 12:52:55 +01:00
idafurjes
490a787d9d
Chore: Move tem member models to team pkg (#61294)
* Chore: Move tem member models to team pkg

* Fix test lint
2023-01-13 09:43:38 +01:00
ying-jeanne
7339dbc090
Chore: Refectory of shorturl service, move models into service (#61295)
Chore: refectory of shorturl service, move models into service
2023-01-12 17:13:47 +08:00
ying-jeanne
6c6a970f56
[Chore] Remove health check that is not used (#61283) 2023-01-11 22:07:28 +08:00
idafurjes
f2ffce4351
Chore: Move team models to models pkg (#61262)
* Chore: Move team models to models pkg

* Fix ACL tests

* More ACL tests

* Change Id to ID in conflict user command test

* Remove team from models

* Fix ac test lint
2023-01-11 14:20:09 +01:00
Kat Yang
9a14a7db03
Chore: Remove star model duplicates (#61191) 2023-01-10 09:56:33 -05:00
idafurjes
7dcb502b33
Chore: Remove org model duplicates (#61025)
Remove org model duplicates
2023-01-09 14:39:53 +01:00
idafurjes
d1c9b308bc
Chore: Move tempuser model to tempuser package (#61024)
* Move tempuser model to tempuser package

* Add xorm tags for ID
2023-01-06 09:02:05 +01:00
idafurjes
bb35f37b66
Chore: Delete org model duplicates (#60940)
* Delete org model duplicates

* Fix lint

* Move OrgDetailsDTO to org pkg
2023-01-04 16:20:26 +01:00
idafurjes
325f7a789e
Chore: Delete duplicate models for user (#60906)
* Delete duplicate models for user

* Use new models in some tests

* Add auth model conversion back
2023-01-03 15:25:35 +01:00
Sofia Papagiannaki
55b014974d
Nested folders: Refactor folder update (#60323)
* Nested folders: Refactor folder update

* Apply suggestions from code review
2022-12-20 15:00:33 +02:00
Sofia Papagiannaki
11d8bcbea9
Guardian: Introduce additional constructors (#59577)
* Guardian: Use dashboard UID instead of ID

* Apply suggestions from code review

Introduce several guardian constructors and each time use
the most appropriate one.
2022-12-15 16:34:17 +02:00
Ryan McKinley
fb98a97efa
EntityStore: Move slug+folder to summary metadata (#59620) 2022-12-01 14:45:08 -05:00
Ryan McKinley
5dc7b01f9d
EntityStore: Rename ObjectStore to EntityStore (part 1) (#59613) 2022-11-30 13:42:42 -08:00
Ryan McKinley
5b71a16acf
Slugify: Replace gosimple/slug with a simple function (#59517) 2022-11-30 11:12:56 -05:00
Jo
fee50be1bb
Sessions: Remove invalid session cookie if it's invalid/expired/missing (#59556)
only remove invalid session cookie if it's invalid/expired/missing
2022-11-30 15:33:19 +01:00
linoman
6cc56311d9
Auth: Display id Provider label in orgs/users view (#58033)
* Add frontend test

* Add frontend label component

* Adjust backend tests

* Retrieve auth IDP labels for users at org/users.

Co-authored-by: Misi <mgyongyosi@users.noreply.github.com>
Co-authored-by: Kalle <kalleep@users.noreply.github.com>
Co-authored-by: Jo <Jguer@users.noreply.github.com>
2022-11-29 15:20:28 +01:00
Karl Persson
189bf102cf
LoginAttempt: Move logic around login attempts into the service (#58962)
* LoginAttemps: Remove from sqlstore mock

* LoginAttemps: Move from models package to service package

* LoginAttemps: Implement functionallity from brute force login in service

* LoginAttemps: Call service

* LoginAttempts: Update name and remove internal functions

* LoginAttempts: Add tests

* LoginAttempt: Add service fake

* LoginAttempt: Register service as a background_services and remove job
from cleanup service

* LoginAttemps: Remove result from command struct

* LoginAttempt: No longer pass pointers
2022-11-22 11:37:18 +01:00
Karl Persson
fef1e1d5bc
Auth: Refactor auth package (#58920)
* Auth: move interface to its own file

* Auth: move to test package

* Auth: move quota consts to auth file

* Auth: move service to impl package

* Auth: move interfaces and related models to auth package

* Auth: Create sub package and type alias to avoid circular dependency
2022-11-18 09:56:06 +01:00
Karl Persson
6e3cb2e3ed
Oauth: Remove unused function for oauth implementations (#58887)
* Oauth: remove unused function

* Oauth: remove unused Oauth types
2022-11-17 15:03:15 +01:00
Sofia Papagiannaki
9855e74b92
Chore: Refactor quota service (#58643)
Chore: Refactor quota service (#57586)

* Chore: refactore quota service

* Apply suggestions from code review
2022-11-14 21:08:10 +02:00
ying-jeanne
b13b58ebf8
Add move endpoint into folder service (#58575)
* add move endpoint

* change signatures
2022-11-10 09:06:52 -05:00
idafurjes
30f0d66983
Folder: Add implementation for Update for nested folder (#58479)
* Add implementation for Update nested folder

* Remove parent uid from Update

* Fix update
2022-11-10 14:28:55 +01:00
Sofia Papagiannaki
96cdf77995
Revert "Chore: Refactor quota service (#57586)" (#58394)
This reverts commit 326ea86a57.
2022-11-08 11:52:07 +02:00
Sofia Papagiannaki
326ea86a57
Chore: Refactor quota service (#57586)
* Chore: refactore quota service

* Apply suggestions from code review
2022-11-08 10:25:34 +02:00
Ryan McKinley
5736b46962
Storage: add support for snapshots, dataframes, and raw json objects (#57934) 2022-11-01 08:28:13 -07:00