Joan López de la Franca Beltran
722c414fef
Encryption: Refactor securejsondata.SecureJsonData to stop relying on global functions ( #38865 )
...
* Encryption: Add support to encrypt/decrypt sjd
* Add datasources.Service as a proxy to datasources db operations
* Encrypt ds.SecureJsonData before calling SQLStore
* Move ds cache code into ds service
* Fix tlsmanager tests
* Fix pluginproxy tests
* Remove some securejsondata.GetEncryptedJsonData usages
* Add pluginsettings.Service as a proxy for plugin settings db operations
* Add AlertNotificationService as a proxy for alert notification db operations
* Remove some securejsondata.GetEncryptedJsonData usages
* Remove more securejsondata.GetEncryptedJsonData usages
* Fix lint errors
* Minor fixes
* Remove encryption global functions usages from ngalert
* Fix lint errors
* Minor fixes
* Minor fixes
* Remove securejsondata.DecryptedValue usage
* Refactor the refactor
* Remove securejsondata.DecryptedValue usage
* Move securejsondata to migrations package
* Move securejsondata to migrations package
* Minor fix
* Fix integration test
* Fix integration tests
* Undo undesired changes
* Fix tests
* Add context.Context into encryption methods
* Fix tests
* Fix tests
* Fix tests
* Trigger CI
* Fix test
* Add names to params of encryption service interface
* Remove bus from CacheServiceImpl
* Add logging
* Add keys to logger
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com >
* Add missing key to logger
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com >
* Undo changes in markdown files
* Fix formatting
* Add context to secrets service
* Rename decryptSecureJsonData to decryptSecureJsonDataFn
* Name args in GetDecryptedValueFn
* Add template back to NewAlertmanagerNotifier
* Copy GetDecryptedValueFn to ngalert
* Add logging to pluginsettings
* Fix pluginsettings test
Co-authored-by: Tania B <yalyna.ts@gmail.com >
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com >
2021-10-07 17:33:50 +03:00
Arve Knudsen
6408b55a7c
Slack: Use chat.postMessage API by default ( #32511 )
...
* Slack: Use only chat.postMessage API
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Slack: Check for response error
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Slack: Support custom webhook URL
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Simplify
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix tests
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Rewrite tests to use stdlib
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Update pkg/services/alerting/notifiers/slack.go
Co-authored-by: Dimitris Sotirakis <sotirakis.dim@gmail.com >
* Clarify URL field name
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix linting issue
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix test
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix up new Slack notifier
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Improve tests
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix lint
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Slack: Make token not required
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Alerting: Send validation errors back to client
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Document how token is required
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Make recipient required when using Slack API
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix field description
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
Co-authored-by: Dimitris Sotirakis <sotirakis.dim@gmail.com >
2021-04-22 16:00:21 +02:00
Arve Knudsen
f326b79cc1
Security: Add gosec G304 auditing annotations ( #29578 )
...
* Security: Add gosec G304 auditing annotations
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* add G304 auditing comment
Signed-off-by: bergquist <carl.bergquist@gmail.com >
* add G304 auditing comment
Signed-off-by: bergquist <carl.bergquist@gmail.com >
* add G304 auditing comment
Signed-off-by: bergquist <carl.bergquist@gmail.com >
* add G304 auditing comment
Signed-off-by: bergquist <carl.bergquist@gmail.com >
* add G304 auditing comment
Signed-off-by: bergquist <carl.bergquist@gmail.com >
* add G304 auditing comment
Signed-off-by: bergquist <carl.bergquist@gmail.com >
* add G304 auditing comment
Signed-off-by: bergquist <carl.bergquist@gmail.com >
* add G304 auditing comment
Signed-off-by: bergquist <carl.bergquist@gmail.com >
* Add gosec annotations
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* add G304 auditing comment
Signed-off-by: bergquist <carl.bergquist@gmail.com >
* add G304 auditing comment
Signed-off-by: bergquist <carl.bergquist@gmail.com >
* Add gosec annotations
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* add G304 auditing comment
Signed-off-by: bergquist <carl.bergquist@gmail.com >
* add G304 auditing comment
Signed-off-by: bergquist <carl.bergquist@gmail.com >
* add G304 auditing comment
Signed-off-by: bergquist <carl.bergquist@gmail.com >
* Add gosec annotations
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* space
Signed-off-by: bergquist <carl.bergquist@gmail.com >
* Add gosec annotations
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
Co-authored-by: bergquist <carl.bergquist@gmail.com >
2020-12-03 22:13:06 +01:00
Arve Knudsen
7897c6b7d5
Chore: Fix staticcheck issues ( #28854 )
...
* Chore: Fix issues reported by staticcheck
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
* Undo changes
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
2020-11-05 11:57:20 +01:00
Arve Knudsen
16c185c3b9
Chore: Drop xerrors dependency ( #26718 )
...
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com >
2020-07-31 09:45:20 +02:00
Maksim Nabokikh
ba2524cd88
Provisioning: Add validation for missing organisations in datasource, dashboard, and notifier configurations ( #26601 )
...
* Provisioning: Check that org. from config exists
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com >
* Apply suggestions from code review
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
* Fix some code after applying suggestions
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com >
* Add negative test case
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com >
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com >
2020-07-30 12:59:12 +03:00
Marcus Efraimsson
7969d6645a
Provisioning: Support alert notification channel secure settings ( #26168 )
...
Closes #25968
2020-07-17 13:54:01 +02: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
Carl Bergquist
db8d7ffbf6
Linting fixes for the provisioning package ( #25690 )
2020-06-30 22:46:41 +02:00
Arve Knudsen
07582a8e85
Chore: Fix various spelling errors in back-end code ( #25241 )
...
* Chore: Fix various spelling errors in back-end code
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com >
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com >>
2020-06-01 17:11:25 +02:00
Mario Trangoni
5116420e9a
Fix misspell issues ( #23905 )
...
* Fix misspell issues
See,
$ golangci-lint run --timeout 10m --disable-all -E misspell ./...
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com >
* Fix codespell issues
See,
$ codespell -S './.git*' -L 'uint,thru,pres,unknwon,serie,referer,uptodate,durationm'
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com >
* ci please?
* non-empty commit - ci?
* Trigger build
Co-authored-by: bergquist <carl.bergquist@gmail.com >
Co-authored-by: Kyle Brandt <kyle@grafana.com >
2020-04-29 21:37:21 +02:00
Carl Bergquist
f9962eabff
chore: avoid aliasing imports in services ( #22499 )
2020-02-29 13:35:15 +01:00
Carl Bergquist
c87b2c9913
docs: fixes typo in provisioning docs ( #17248 )
...
closes #17196
2019-05-23 13:06:34 +02:00
zhulongcheng
2fff8f77dc
move log package to /infra ( #17023 )
...
ref #14679
Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com >
2019-05-13 08:45:54 +02:00
Andrej Ocenas
fcebd713a5
Provisioning: Interpolate env vars in provisioning files ( #16499 )
...
* Add value types with custom unmarshalling logic
* Add env support for notifications config
* Use env vars in json data tests for values
* Add some more complexities to value tests
* Update comment with example usage
* Set env directly in the tests, removing patching
* Update documentation
* Add env var to the file reader tests
* Add raw value
* Post merge fixes
* Add comment
2019-04-24 15:39:47 +02:00
Marcus Efraimsson
b4267eafb8
log root cause error when reading from provisioning directories
2019-02-07 15:46:57 +01:00
bergquist
11c4967bdc
changes some info logging to debug
2019-01-31 21:51:14 +01:00
bergquist
809019d4ee
moves test files into testdata folder
2019-01-28 20:44:10 +01:00
bergquist
8f0e65a150
renames alert_notifications -> notifiers
2019-01-28 20:39:09 +01:00