Commit Graph

9705 Commits

Author SHA1 Message Date
Kat Yang
9a14a7db03
Chore: Remove star model duplicates (#61191) 2023-01-10 09:56:33 -05:00
Cyril Tovena
ad1813da27
Phlare: Update client code to use v0.1.2 API. (#60941)
* Depends on Phlare API instead of copying the code

* Rollback the breaking change from the API version
2023-01-10 14:16:45 +00:00
Jo
0c8ad80575
Authn: JWT client (#61157)
* add jwt client

* alias JWT verifier

* debug implementation

* add tests for jwt client

* add constant for JWT module

* Feedback

Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
Co-authored-by: Mihály Gyöngyösi <mgyongyosi@users.noreply.github.com>

Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
Co-authored-by: Mihály Gyöngyösi <mgyongyosi@users.noreply.github.com>
2023-01-10 15:08:52 +01:00
Karl Persson
2de72c1c39
AuthN: Login (#61225)
* AuthN: Add function to login auth request
2023-01-10 14:55:27 +01:00
Karl Persson
c5f77b6a46
AuthN: Set LookupTokenErr and fall through in case of error (#61217)
ContextHandler: Set LookupTokenErr and fall through in case of error
during authentication
2023-01-10 14:36:02 +01:00
Ashley Harrison
4e00fbbd7f
Navigation: Allow overriding icons in nav settings (#61160)
expose k6 icon, allow overriding icon in nav settings, override connections + k6
2023-01-10 10:29:07 +00:00
Ivana Huckova
256f640e19
Elasticsearch: Refactor processQuery to make it more readable (#61145)
* WIP: Simplify process query logic

* WIP: Simplify process query logic

* Simplify

* fix lint
2023-01-10 10:49:43 +01:00
Yuri Tseretyan
da18c89e91
Alerting: Scheduler to call DeleteAlertRule once when it stops deleted rules (#61189)
scheduler to call DeleteAlertRule once when it stops deleted rules
2023-01-09 14:39:32 -05:00
George Robinson
402dc5e4d6
Alerting: Redo refactoring from reverted fix in #56812 (#61051)
This pull request re-applies the refactoring of ConditionsCmd from a
reverted fix #56812 for mathexp.noData. It does not add the fix, or
tests for the fix, because those were added in #56816. We use the
additional test coverage added in #56816 and #58650 to avoid the
reoccurrence of regressions that caused us to revert #56812 the
first time.
2023-01-09 17:01:19 +00:00
Karl Persson
a49892c9ac
AuthN: Refactor basic auth client to support multiple password auth (#61153)
* AuthN: add interface for password clients

* AuthN: Extract grafana password client

* AuthN: Rewrite basic client tests

* AuthN: Add Ldap client and rename method of PasswordClient

* AuthN: Configure multiple password clients

* AuthN: create ldap service and add tests
2023-01-09 16:40:29 +01:00
Erik Sundell
c3378aff8b
Cloudwatch: Use new log group picker also for non cross-account queries (#60913)
* use new log group picker also for non cross-account queries

* cleanup and add comment

* remove not used code

* remove not used test

* add error message when trying to set log groups before saving

* fix bugs from pr feedback

* add more tests

* fix broken test
2023-01-09 16:30:21 +01:00
Yuri Tseretyan
2b61fb6e4a
Test Datasource: do not use global random (#61116) 2023-01-09 10:08:58 -05:00
Yuri Tseretyan
9f503a261a
Traces: Create span when a new session is opened (#61115) 2023-01-09 09:41:15 -05:00
Yuri Tseretyan
e7b17cde47
Traces: Fix timestamp for database query traces (#61109) 2023-01-09 09:40:55 -05:00
idafurjes
7dcb502b33
Chore: Remove org model duplicates (#61025)
Remove org model duplicates
2023-01-09 14:39:53 +01:00
Karl Persson
68b43a24e2
RBAC: dashboard permission filter (#60582)
* PermissionFilter: Handle all search type and only check one action for dashboards

* PermissionFilter: Still handle multiple action but take short cut when
only one action is required
2023-01-09 14:38:57 +01:00
Karl Persson
3b08946fd3
RBAC: Update org invite rbac tests to not used mocked access control (#61141) 2023-01-09 12:23:24 +01:00
Karl Persson
e0c7ef3481
RBAC: Rewrite rbac annotations test (#61036)
* API: Rewrite annotation rbac tests to not use mocked access control

* API: rewrite mass deletion rbac tests
2023-01-09 09:59:14 +01:00
Alexander Zobnin
f1b5014efd
Preferences: Add pagination to org configuration page (#60896)
* Add auth labels and access control metadata to org users search results

* Fix search result JSON model

* Org users: Use API for pagination

* Fix default page size

* Refactor: UsersListPage to functional component

* Refactor: update UsersTable component code style

* Add pagination to the /orgs/{org_id}/users endpoint

* Use pagination on the AdminEditOrgPage

* Add /orgs/{org_id}/users/search endpoint to prevent breaking API

* Use existing search store method

* Remove unnecessary error

* Remove unused

* Add query param to search endpoint

* Fix endpoint docs

* Minor refactor

* Fix number of pages calculation

* Use SearchOrgUsers for all org users methods

* Refactor: GetOrgUsers as a service method

* Minor refactor: rename orgId => orgID

* Fix integration tests

* Fix tests
2023-01-09 11:54:33 +03:00
Yuri Tseretyan
d44de7f20a
Annotations: AddMany to not open session if nothing to save (#61117) 2023-01-06 21:23:46 -05:00
Yuri Tseretyan
48f1db63ff
Alerting: Add support for tracing to alerting scheduler (#61057) 2023-01-06 21:21:43 -05:00
Alexander Weaver
eb960d9725
Alerting: Add un-documented toggle for changing state history backend, add shells for remote loki and sql (#61072)
* Add toggle for state history backend and shells

* Extract some shared logic and add tests
2023-01-06 12:06:01 -06:00
sam boyer
4db3b2fd5c
Kindsys: Remove defs, Slot->SchemaInterface (#61069)
* kindsys: Remove defs, Slot->SchemaInterface

* Remove excess file

* Fix up tests

* Regenerate kinds report

* Final bits of cleanup

* Stop complaining, linter

* Update pkg/kindsys/kindcat_composable.cue

Co-authored-by: Tania <yalyna.ts@gmail.com>

Co-authored-by: Tania <yalyna.ts@gmail.com>
2023-01-06 12:37:32 -05:00
Jo
c2ad447f8c
AuthN: Document identity and add missing fields (#61094)
* add missing fields in identity

* add description of Identity fields
2023-01-06 15:58:02 +00:00
Sofia Papagiannaki
e2ed42c2a3
Nested folders: Do not expose the sequential ID from the folder store (#60702)
* Nested folders: Do not expose the sequential ID from the folder store
2023-01-06 16:04:17 +02:00
Ivana Huckova
30424a8618
Elasticsearch: Return error if invalid query (#61044)
* Elasticsearch: Return error if invalid query

* Add test

* Fix query in test
2023-01-06 11:14:17 +01:00
Jack Baldry
410b23c3d9
Use preferred package header for generated code (#61059)
* Use preferred package header for generated code

> To convey to humans and machine tools that code is generated, generated source should have a line that matches the following regular expression (in Go syntax):
> `^// Code generated .* DO NOT EDIT\.$`

https://pkg.go.dev/cmd/go#hdr-Generate_Go_files_by_processing_source

Co-authored-by: sam boyer <sdboyer@grafana.com>
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Regenerate files with updated header

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: sam boyer <sdboyer@grafana.com>
2023-01-06 04:57:45 -05:00
mikkancso
18f5f763a9
Connections: Align permissions for Connections page (#60725)
* protect /connection url paths with permissions

These permissions match the original ones at /datasources and /plugins

* add Connections section to navtree only if user has permissions

This commit works only when the easystart plugin is not present.
I'll see what I can do when it is present in the next commit(s).

* update datasources page permissions

The datasources page have Explore buttons on datasource entries,
therefore it makes sense to show this page for those, who can't edit or
create datasources but have explore permissions.
This applies for the traditional Editor role.

* DataSourcesList: link to edit page only if has right to write

If the user doesn't have rights to write datasources, then it's better
to not create a link from cards to the edit page. This way they won't
see the configuration of the data sources either, which is a desirable
outcome.

Also, I moved the query for DataSourcesExplore permission out from the
DataSourcesListView component in the DataSourcesList component, next to
the other permission queries - for the sake of consistency.

* fix permissions for connect data

This way it matches the permissions of the "Plugins" page.

* fix applinks test
2023-01-06 03:11:27 -05: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
Levente Balogh
fc0e3d6c14
Connections: use the "adjust-circle" icon as a logo (#61046)
* feat: add a new icon called 'adjust-circle'

* feat(Connetions): use the `adjust-circle` logo
2023-01-06 07:31:49 +01:00
Joan López de la Franca Beltran
dc20b776bb
Kindsys: New schema for Kinds report (#61034)
* New (desired) report output

* Kinds: New schema for kinds report

* Update report.json

* Sort dimension items
2023-01-05 22:48:13 +01:00
Karl Persson
cdd7392f68
AuthN: Make client params part of the identity (#61050)
* AuthN: Change client params to be a return value of authenticate

* AuthN: move client params to be part of the identity
2023-01-05 20:17:41 +01:00
Karl Persson
183397194a
RBAC: rewrite team member api test to not use mock (#61040)
* RBAC: rewrite team member api test to not use mock
2023-01-05 20:08:07 +01:00
Selene
8f29450594
Kindsys: Remove Raw kind category (#60992)
* Remove Raw references

* Remove more raws

* Re-generate files

* Remove raw folder from veneer

* Fix import

* Fix lint

* Bring back raw folder in grafana-schema

* Another lint

* Remove use of "Structured" word in kinds

* Delete unused function and remove some structured words

* Bunch more removals of structured name

Co-authored-by: sam boyer <sdboyer@grafana.com>
2023-01-05 13:54:42 -05:00
Alexander Weaver
8c3a5f6da0
Alerting: Allow state history to be disabled through configuration (#61006)
* Add configuration option for if state history should be enabled

* Inject no-op when history is disabled
2023-01-05 12:21:07 -06:00
Gabriel MABILLE
6da850a2f2
RBAC: Add function to reduce permissions (#58197)
* RBAC: Add function to reduce permissions

* Make names readable

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

* Remove copy pasted comment

* Nit.

Co-authored-by: Jguer <joao.guerreiro@grafana.com>
Co-authored-by: Mihaly Gyongyosi <mgyongyosi@users.noreply.github.com>
2023-01-05 16:32:13 +00:00
George Robinson
9af7adef76
Alerting: Support customizable timeout for screenshots (#60981)
This commit adds a customizable timeout for screenshots called
capture_timeout. The default value is 10 seconds, and the maximum
value is 30 seconds. This timeout should be less than the minimum
Interval of all Evaluation Groups to avoid back pressure on alert
rule evaluation.
2023-01-05 16:07:46 +00:00
Jo
fc0926f8fb
SupportBundles: Recover from Bundler panics gracefully (#60995)
bundler panics should not crash Grafana
2023-01-05 14:23:35 +01:00
Ivana Huckova
772e8cbf60
Elasticsearch: Use interval provided by data request in backend (#60480)
* Elasticsearch: Remove interval caulation and use interval provises by grafana

* Remove redundant code

* Adjust snapshot tests

* Update test

* Fix lint
2023-01-05 12:26:27 +01:00
Ieva
9334582022
RBAC: move RBAC + OnCall feature toggle to beta state (#60991)
* move RBAC + OnCall feature toggle to beta state

* move accessControlOnCall to the correct section in the docs
2023-01-04 17:52:08 +01:00
Alexander Weaver
0e7640475f
Alerting: Store alertmanager configuration history in a separate table in the database (#60492)
* Update config store to split between active and history tables

* Migrations to fix up indexes

* Implement migration from old format to new

* Move add migrations call

* Delete duplicated rows

* Explicitly map fields

* Quote the column name because it's a reserved word

* Lift migrations to top

* Use XORM for nearly everything, avoid any non trivial raw SQL

* Touch up indexes and zero out IDs on move

* Drop TODO that's already completed

* Fix assignment of IDs
2023-01-04 10:43:26 -06:00
Jo
c74d86ca27
SupportBundles: Move support bundles to services (#60986)
* move support bundles to services

* update CODEOWNERS
2023-01-04 17:33:18 +01:00
Alexander Weaver
1381fb6dfc
Annotations: Fix EpochEnd being zero for Alert-generated annotations (#60931)
* Revert linter suggestion

* Re-add nolint

* Work in terms of pointer rather than copy

* Add tests covering validation

* Add comment
2023-01-04 10:16:54 -06:00
Karl Persson
d572ccdb2a
AuthN: tune logging (#60917)
* AuthN: remove comment

* AuthN: Only start trace if valid authentication client is used
2023-01-04 16:25:42 +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
Jo
9633b5c69c
SupportBundles: Improve UX (#60964)
implement of easy frontend fixes for bundle list
2023-01-04 16:11:02 +01:00
Jo
a226903ec6
AuthN: Add session client (#60894)
* add basic session client

* populate UserToken in ReqContext

* token rotation as a post auth hook

* fixed in context handler

* add session token rotation

* add session token tests

* use namespacedID constructor
2023-01-04 16:10:43 +01:00
Yuri Tseretyan
4d989860fb
Alerting: Fix conversion of alert state from db state during manager warmup (#60933) 2023-01-04 09:40:04 -05:00
Gábor Farkas
12c4098bcd
elastic: backend: handle naming bucket_scripts (#60460) 2023-01-04 15:26:57 +01:00
Karl Persson
da24a9d74e
AuthN: Add render auth client (#60914)
* AuthN: Add boilderplate for render auth client

* AuthN: Implement test function for render auth client

* AuthN: Implement Authenticate for render arender auth client

* ContextHandler: Perform render auth if flag is enabled
2023-01-04 13:48:00 +01:00