grafana/pkg/setting
Gabriel MABILLE edf1775d49
AuthN: Embed an OAuth2 server for external service authentication (#68086)
* Moving POC files from #64283 to a new branch

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

* Adding missing permission definition

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

* Force the service instantiation while client isn't merged

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

* Merge conf with main

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

* Leave go-sqlite3 version unchanged

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

* tidy

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

* User SearchUserPermissions instead of SearchUsersPermissions

* Replace DummyKeyService with signingkeys.Service

* Use user🆔<id> as subject

* Fix introspection endpoint issue

* Add X-Grafana-Org-Id to get_resources.bash script

* Regenerate toggles_gen.go
* Fix basic.go

* Add GetExternalService tests

* Add GetPublicKeyScopes tests

* Add GetScopesOnUser tests

* Add GetScopes tests

* Add ParsePublicKeyPem tests

* Add database test for GetByName

* re-add comments

* client tests added

* Add GetExternalServicePublicKey tests

* Add other test case to GetExternalServicePublicKey

* client_credentials grant test

* Add test to jwtbearer grant

* Test Comments

* Add handleKeyOptions tests

* Add RSA key generation test

* Add ECDSA by default to EmbeddedSigningKeysService

* Clean up org id scope and audiences

* Add audiences to the DB

* Fix check on Audience

* Fix double import

* Add AC Store mock and align oauthserver tests

* Fix test after rebase

* Adding missing store function to mock

* Fix double import

* Add CODEOWNER

* Fix some linting errors

* errors don't need type assertion

* Typo codeowners

* use mockery for oauthserver store

* Add feature toggle check

* Fix db tests to handle the feature flag

* Adding call to DeleteExternalServiceRole

* Fix flaky test

* Re-organize routes comments and plan futur work

* Add client_id check to Extended JWT client

* Clean up

* Fix

* Remove background service registry instantiation of the OAuth server

* Comment cleanup

* Remove unused client function

* Update go.mod to use the latest ory/fosite commit

* Remove oauth2_server related configs from defaults.ini

* Add audiences to DTO

* Fix flaky test

* Remove registration endpoint and demo scripts. Document code

* Rename packages

* Remove the OAuthService vs OAuthServer confusion

* fix incorrect import ext_jwt_test

* Comments and order

* Comment basic auth

* Remove unecessary todo

* Clean api

* Moving ParsePublicKeyPem to utils

* re ordering functions in service.go

* Fix comment

* comment on the redirect uri

* Add RBAC actions, not only scopes

* Fix tests

* re-import featuremgmt in migrations

* Fix wire

* Fix scopes in test

* Fix flaky test

* Remove todo, the intersection should always return the minimal set

* Remove unecessary check from intersection code

* Allow env overrides on settings

* remove the term app name

* Remove app keyword for client instead and use Name instead of ExternalServiceName

* LogID remove ExternalService ref

* Use Name instead of ExternalServiceName

* Imports order

* Inline

* Using ExternalService and ExternalServiceDTO

* Remove xorm tags

* comment

* Rename client files

* client -> external service

* comments

* Move test to correct package

* slimmer test

* cachedUser -> cachedExternalService

* Fix aggregate store test

* PluginAuthSession -> AuthSession

* Revert the nil cehcks

* Remove unecessary extra

* Removing custom session

* fix typo in test

* Use constants for tests

* Simplify HandleToken tests

* Refactor the HandleTokenRequest test

* test message

* Review test

* Prevent flacky test on client as well

* go imports

* Revert changes from 526e48ad45

* AuthN: Change the External Service registration form (#68649)

* AuthN: change the External Service registration form

* Gen default permissions

* Change demo script registration form

* Remove unecessary comment

* Nit.

* Reduce cyclomatic complexity

* Remove demo_scripts

* Handle case with no service account

* Comments

* Group key gen

* Nit.

* Check the SaveExternalService test

* Rename cachedUser to cachedClient in test

* One more test case to database test

* Comments

* Remove last org scope

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

* Update pkg/services/oauthserver/utils/utils_test.go

* Update pkg/services/sqlstore/migrations/oauthserver/migrations.go

Remove comment

* Update pkg/setting/setting.go

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

---------

Co-authored-by: Mihály Gyöngyösi <mgyongyosi@users.noreply.github.com>
2023-05-25 15:38:30 +02:00
..
testdata
date_formats_test.go Chore: Fix goimports grouping in other backend platform packages (#62422) 2023-01-30 08:26:42 +00:00
date_formats.go
dynamic_settings_test.go
expanders_test.go Chore: Fix goimports grouping in other backend platform packages (#62422) 2023-01-30 08:26:42 +00:00
expanders.go Handle ioutil deprecations (#53526) 2022-08-10 15:37:51 +02:00
provider.go Add verbose settings (#65469) 2023-04-20 04:43:28 -04:00
setting_azure_test.go Azure: Configuration for user identity authentication in datasources (Experimental) (#50277) 2023-05-15 18:00:54 +01:00
setting_azure.go Azure: Configuration for user identity authentication in datasources (Experimental) (#50277) 2023-05-15 18:00:54 +01:00
setting_data_proxy.go Datasources: Add user_agent header customization for outgoing HTTP requests (#63769) 2023-02-28 14:10:05 +01:00
setting_feature_toggles_test.go
setting_feature_toggles.go Chore: Fix goimports grouping in other backend platform packages (#62422) 2023-01-30 08:26:42 +00:00
setting_grafana_javascript_agent.go Frontend logging: Remove Sentry javascript agent support (#67493) 2023-05-02 12:10:56 +03:00
setting_plugins_test.go
setting_plugins.go Chore: Allow to force the download of the public key (#67486) 2023-04-28 16:00:48 +02:00
setting_quota.go Add quota setting for correlations (#65076) 2023-03-21 15:27:25 -05:00
setting_search.go Search: Add search index configuration options (#55525) 2022-09-20 19:09:55 -04:00
setting_secure_socks_proxy.go Plugins: add option to proxy ds connections through a secure socks proxy (#59254) 2022-11-29 23:50:59 -06:00
setting_session_test.go Chore: Fix goimports grouping in other backend platform packages (#62422) 2023-01-30 08:26:42 +00:00
setting_smtp.go
setting_storage.go Storage: externalize allow_unsanitized_svg_upload (#52703) 2022-07-25 21:11:17 +04:00
setting_test.go Settings: Do not hide sensitive values if it's empty (#68088) 2023-05-10 12:30:50 +02:00
setting_unified_alerting_test.go Refactor time durations (#58484) 2022-11-22 15:09:15 +08:00
setting_unified_alerting.go Alerting: Add option for memberlist label (#67982) 2023-05-09 10:32:23 +02:00
setting.go AuthN: Embed an OAuth2 server for external service authentication (#68086) 2023-05-25 15:38:30 +02:00