Go to file
Eric Leijonmarck 9c11040c3e
Serviceaccounts: Filtering service accounts from user queries (#41410)
* Add extra fields to OSS types to support enterprise

* WIP service accounts

* Update public/app/features/api-keys/ApiKeysForm.tsx

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>

* Create a service account at the same time as the API key

* Use service account credentials when accessing API with APIkey

* Throw better error

* Use Boolean for "create service account button"

* Add GetRole to service, merge RoleDTO and Role structs

This patch merges the identical OSS and Enterprise data structures, which improves the code for two reasons:

1.  Makes switching between OSS and Enterprise easier
2.  Reduces the chance of incompatibilities developing between the same functions in OSS and Enterprise

* Start work cloning permissions onto service account

* If API key is not linked to a service account, continue login as usual

* Fallback to old auth if no service account linked to key

* Commented

* Add CloneUserToServiceAccount

* Update mock.go

* Put graphical bits behind a feature toggle

* Start adding LinkAPIKeyToServiceAccount

* Update pkg/models/user.go

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>

* Update pkg/api/apikey.go

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>

* Update pkg/api/apikey.go

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>

* Finish LinkAPIKeyToServiceAccount

* Update comment

* Handle api key link error

* Update pkg/services/sqlstore/apikey.go

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

* Feature toggle

* Update pkg/services/accesscontrol/accesscontrol.go

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

* Not needed (yet)

* Better error messages for OSS accesscontrol

* Set an invalid user id as default

* ServiceAccountId should be string

* Re-arrange field names

* ServiceAccountId is integer

* Update ossaccesscontrol.go

* Linter

* Remove fronend edits

* Remove console log

* Update ApiKeysForm.tsx

* feat: add serviceaccount deletion

* feat: make sure we do not accidently delete serviceaccount

* feat: ServiceAccount Type

* refactor: userDeletions function

* refactor: serviceaccount deletions\

* refactor: error name and removed attribute for userDeletecommand

* refactor:: remove serviceaccount type for now

* WIP

* add mocked function

* Remove unnecessary db query, move to right place

* Update pkg/services/accesscontrol/mock/mock.go

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* Update pkg/services/accesscontrol/mock/mock.go

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* Update pkg/services/accesscontrol/mock/mock.go

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

* Better error messages

* Better and correcter error messages

* add mocked function

* refactor: move function call, add error msg

* add IsServiceAccount and fix table

* add service accounts package

* WIP

* WIP

* working serviceaccountsapi registration

* WIP tests

* test

* test working

* test running for service

* moved the error out of the models package

* fixed own review

* linting errors

* Update pkg/services/serviceaccounts/database/database.go

Co-authored-by: Jeremy Price <Jeremy.price@grafana.com>

* tests running for api

* WIP

* WIP

* removed unused secrets background svc

* removed background svc for serviceaccount infavor or wire.go

* serviceaccounts manager tests

* wip

* Filtering service accounts from the user queries in frontend

* clean up

* Update pkg/services/sqlstore/org_test.go

* methods on same type should have same receiver

* _ unused variable and comment

* add additional join for results query

* remove unused code

* remove error fmt

* refactor: change to only have false

* no new variable to the left hand side

* refactor: create serviceaccount cmd

* dialect fix

Co-authored-by: Jeremy Price <jeremy.price@grafana.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2021-11-23 23:06:40 +00:00
.bingo Makefile: Force use `drone-cli 1.4.0` version (#40385) 2021-10-14 16:02:45 +02:00
.circleci
.github Ignore react-icons bump for now (#41537) 2021-11-22 17:32:31 +00:00
.husky Chore: bump Husky to v7 (#40797) 2021-11-02 11:53:27 +01:00
.vscode Dev: Add debug jest test to vscode launch (#39905) 2021-10-04 14:26:19 +02:00
.yarn Update pa11y-ci commit hash to 6b2d4f5 (#41536) 2021-11-11 09:51:47 +01:00
conf Encryption: Add settings to ini files (#42057) 2021-11-23 20:29:35 +02:00
contribute Grafana CLI Wire Runner (#41012) 2021-11-17 20:43:09 +01:00
cue/scuemata Apply cuetsy attrs to PanelSchema (#39112) 2021-09-15 12:27:47 -04:00
cue.mod
devenv Elasticsearch: Add support for Elasticsearch 8.0 (Beta) (#41729) 2021-11-17 20:30:53 +01:00
docs Alerting: Document Alertmanager/Prometheus versions we support (#42160) 2021-11-23 18:41:48 +01:00
e2e Update dependency cypress to v9 (#41588) 2021-11-19 17:19:53 +00:00
emails Alerting: Add value to notifier template (#41951) 2021-11-22 08:45:44 +01:00
grafana-mixin Update the grafana-mixin to use HTTP histograms (#39155) 2021-10-06 14:15:12 +02:00
packages Geomap: Add rotation option for markers layer (#41992) 2021-11-23 08:23:43 -08:00
packaging Dockerfile: Bump Go and Alpine versions (#41922) 2021-11-19 18:59:24 +01:00
pkg Serviceaccounts: Filtering service accounts from user queries (#41410) 2021-11-23 23:06:40 +00:00
plugins-bundled Chore: Bump versions to 8.4.0-pre (#42116) 2021-11-23 11:23:02 +01:00
public Geomap: Add rotation option for markers layer (#41992) 2021-11-23 08:23:43 -08:00
scripts Chore: Split nightly docker image scan into separate pipelines (#42097) 2021-11-23 11:43:00 +01:00
tools
.bra.toml Revert "Bra: Run wire re-gen on code change (#39774)" (#39799) 2021-09-29 17:26:04 +02:00
.browserslistrc
.dockerignore Add support for local Makefile to docker (#41296) 2021-11-04 11:13:10 -03:00
.drone.star Chore: Rename scripts/star dir to scripts/drone (#38910) 2021-09-07 12:15:04 +03:00
.drone.yml Chore: Split nightly docker image scan into separate pipelines (#42097) 2021-11-23 11:43:00 +01:00
.editorconfig
.eslintignore Add deployment_tools_config.json to git and eslint ignore (#42053) 2021-11-22 12:36:21 +01:00
.eslintrc
.gitattributes
.gitignore Add deployment_tools_config.json to git and eslint ignore (#42053) 2021-11-22 12:36:21 +01:00
.pa11yci-pr.conf.js Update .pa11yci-pr.conf.js (#42148) 2021-11-23 16:43:37 +00:00
.pa11yci.conf.js Pipeline: Fix flakiness on Pa11y CI (#39358) 2021-09-23 15:02:30 +02:00
.prettierignore Geomap: Minor style fixes (#38532) 2021-08-26 10:17:03 +02:00
.prettierrc.js
.yarnrc.yml Chore: explicitly set nodeLinker in yarnrc (#41089) 2021-10-29 13:32:50 +02:00
CHANGELOG.md ReleaseNotes: Updated changelog and release notes for 8.3.0-beta1 (#42044) 2021-11-23 11:05:27 +01:00
CHANGELOG_ARCHIVE.md Prettier: Fix all markdown files and add markdown files to CI verify step (#39776) 2021-09-29 14:34:40 +02:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md Postgres: For template queries return [] and not error (#38060) 2021-08-19 13:43:41 +02:00
Dockerfile Fix: add the babel config to the dockerfiles (#42021) 2021-11-20 15:40:13 +01:00
Dockerfile.ubuntu Fix: add the babel config to the dockerfiles (#42021) 2021-11-20 15:40:13 +01:00
GOVERNANCE.md Update GOVERNANCE.md (#36223) 2021-06-28 17:55:25 +02:00
ISSUE_TRIAGE.md Prettier: Fix all markdown files and add markdown files to CI verify step (#39776) 2021-09-29 14:34:40 +02:00
LICENSE
LICENSING.md Put vendored code under their upstream licenses explicitly (#36442) 2021-07-05 21:33:01 +02:00
MAINTAINERS.md
Makefile Grafana CLI Wire Runner (#41012) 2021-11-17 20:43:09 +01:00
NOTICE.md Prettier: Fix all markdown files and add markdown files to CI verify step (#39776) 2021-09-29 14:34:40 +02:00
PLUGIN_DEV.md Chore: Updated the link to the plugin developer guide docs - it used to point to an old version (#40710) 2021-10-25 12:11:44 +04:00
README.md update links in README.md (#33195) 2021-09-21 10:21:27 -04:00
ROADMAP.md Prettier: Fix all markdown files and add markdown files to CI verify step (#39776) 2021-09-29 14:34:40 +02:00
SECURITY.md Prettier: Fix all markdown files and add markdown files to CI verify step (#39776) 2021-09-29 14:34:40 +02:00
SUPPORT.md Prettier: Fix all markdown files and add markdown files to CI verify step (#39776) 2021-09-29 14:34:40 +02:00
UPGRADING_DEPENDENCIES.md remove GO111MODULE (#36235) 2021-06-29 10:01:21 +02:00
WORKFLOW.md Prettier: Fix all markdown files and add markdown files to CI verify step (#39776) 2021-09-29 14:34:40 +02:00
api-extractor.json
babel.config.json Chore: Move babel config to a root babel.config.json (#41615) 2021-11-18 16:38:58 +00:00
build.go Chore: move build command to importable package (#38726) 2021-09-03 11:24:21 -05:00
embed.go Make "dist" version of dashboard scuemata directly importable in CUE (#39251) 2021-09-17 16:17:55 -04:00
go.mod Update cuetsy to latest (#42015) 2021-11-19 23:39:21 +01:00
go.sum Update cuetsy to latest (#42015) 2021-11-19 23:39:21 +01:00
jest.config.js Chore: Switch yarn 2 to plug-n-play strategy (#40300) 2021-10-27 14:21:07 +01:00
latest.json Update latest.json (#42115) 2021-11-23 11:10:57 +01:00
lerna.json Chore: Bump versions to 8.4.0-pre (#42116) 2021-11-23 11:23:02 +01:00
metadata.md
package.json Update sentry-javascript monorepo to v6 (#41991) 2021-11-23 15:59:32 +00:00
stylelint.config.js Chore: Replace Sass-lint with Stylelint (#40617) 2021-10-20 11:34:24 +02:00
tsconfig.json Build: Enable persistent cache for faster Webpack builds (#41430) 2021-11-11 14:32:34 +01:00
yarn.lock Update sentry-javascript monorepo to v6 (#41991) 2021-11-23 15:59:32 +00:00

README.md

Grafana

The open-source platform for monitoring and observability.

License Drone Go Report Card

Grafana allows you to query, visualize, alert on and understand your metrics no matter where they are stored. Create, explore, and share dashboards with your team and foster a data driven culture:

  • Visualize: Fast and flexible client side graphs with a multitude of options. Panel plugins offer many different ways to visualize metrics and logs.
  • Dynamic Dashboards: Create dynamic & reusable dashboards with template variables that appear as dropdowns at the top of the dashboard.
  • Explore Metrics: Explore your data through ad-hoc queries and dynamic drilldown. Split view and compare different time ranges, queries and data sources side by side.
  • Explore Logs: Experience the magic of switching from metrics to logs with preserved label filters. Quickly search through all your logs or streaming them live.
  • Alerting: Visually define alert rules for your most important metrics. Grafana will continuously evaluate and send notifications to systems like Slack, PagerDuty, VictorOps, OpsGenie.
  • Mixed Data Sources: Mix different data sources in the same graph! You can specify a data source on a per-query basis. This works for even custom datasources.

Get started

Unsure if Grafana is for you? Watch Grafana in action on play.grafana.org!

Documentation

The Grafana documentation is available at grafana.com/docs.

Contributing

If you're interested in contributing to the Grafana project:

Get involved

License

Grafana is distributed under AGPL-3.0-only. For Apache-2.0 exceptions, see LICENSING.md.