Commit Graph

1969 Commits

Author SHA1 Message Date
Leonard Gram
21d3d27452 teams: editors can't remove the last admin from a team. 2019-03-19 14:01:13 +01:00
Leonard Gram
b783fa7039 team: renames teams.CanUpdate teamguardian.CanAdmin 2019-03-19 14:01:12 +01:00
Leonard Gram
a6a3d698da teams: cleanup. 2019-03-19 13:57:30 +01:00
Leonard Gram
0b209de5d1 dashboard: only admin permission added to dashboard in folder. 2019-03-19 13:57:30 +01:00
Leonard Gram
89d4db8eb6 teams: team listing shows only your teams (editors). 2019-03-19 13:57:29 +01:00
Leonard Gram
8e7a8282c1 teams: removed feature toggle as it is already in middleware 2019-03-19 13:57:28 +01:00
Leonard Gram
d668550aa2 teams: added feature toggle and refactor tests 2019-03-19 13:57:28 +01:00
Leonard Gram
0d61f89577 teams: cleanup. 2019-03-19 13:57:28 +01:00
Leonard Gram
3be1d71f1f teams: test refactorings. 2019-03-19 13:57:27 +01:00
Leonard Gram
319879cfa8 teams: bugfix, user pointer. 2019-03-19 13:57:27 +01:00
Leonard Gram
90e9fda90c teams: start of team update guardian for editors 2019-03-19 13:57:26 +01:00
Hugo Häggmark
5adde259d3 teams: team update test 2019-03-19 13:57:26 +01:00
Hugo Häggmark
3c46b786d2 teams: change back to permissionlevel for Member to 0 2019-03-19 13:57:26 +01:00
Hugo Häggmark
3c74ac3044 teams: update only the selected user 2019-03-19 13:57:25 +01:00
Leonard Gram
aedc478208 teams: test for update team member. 2019-03-19 13:57:24 +01:00
Leonard Gram
2a88052c14 teams: can update team members permission. 2019-03-19 13:57:23 +01:00
Hugo Häggmark
7888457aae teams: basic ui for permission in team members view 2019-03-19 13:57:23 +01:00
Leonard Gram
af4994ba16 teams: editor added as admin for created teams. 2019-03-19 13:57:22 +01:00
Leonard Gram
da3dcd1918 folder: uses service to make user admin of created folder. 2019-03-19 13:57:21 +01:00
Leonard Gram
c8c004095c permissions: broken out func for making creator admin. 2019-03-19 13:57:21 +01:00
Leonard Gram
e174f7c20b folders: admin for created folders 2019-03-19 13:57:20 +01:00
Leonard Gram
e294252e92 dashboards: user automatically becomes admin for created dashboards 2019-03-19 13:57:20 +01:00
Sean Lafferty
3f9a19dcd5 Merge branch 'master' into 12556-oauth-pass-thru 2019-03-14 13:18:00 -04:00
Carl Bergquist
23852b59c9
Merge pull request #15839 from grafana/15836_revoke_auth_tokens
Support list and revoke of user auth tokens in HTTP API
2019-03-14 17:12:49 +01:00
Carl Bergquist
291ffcb75b
Merge pull request #15457 from bergquist/distributed_cache
Distributed cache
2019-03-14 16:16:39 +01:00
Sean Lafferty
f3c52710df Make recently used auth_module test more robust by adding another 'log in' 2019-03-14 08:40:19 -04:00
zhulongcheng
755f60358b Add more info to victorOps alert notifications 2019-03-14 15:47:11 +08:00
Sean Lafferty
8d19ca005f Merge branch 'master' into 12556-oauth-pass-thru 2019-03-13 14:25:43 -04:00
Sean Lafferty
de338338bf Remove todo about index on user_id in user_auth because it exists 2019-03-13 13:46:49 -04:00
Sean Lafferty
f17307bb97 Always return most recently used auth_module from GetAuthInfo 2019-03-13 11:29:13 -04:00
Sean Lafferty
d922285ab8 Move oauth token migrations in user_auth_mig 2019-03-11 09:31:03 -04:00
Torkel Ödegaard
5fab1e89d3
Merge pull request #15897 from grafana/revert-15608-fix-datasource-update
Revert "Fix Datasource Update to no User/Password"
2019-03-11 10:58:28 +01:00
bergquist
66e71b66dd renames key to cache_key
apparently key is a reserved keyword in mysql.
and the error messages doesnt mention that.
can I please have 6h back?
2019-03-11 10:49:55 +01:00
Carl Bergquist
f3753712e0
Revert "Fix Datasource Update to no User/Password" 2019-03-11 07:22:54 +01:00
genofire
6d578dd372
fix imageurl in notification test
skip unnecessary http -> https redirect, which could make problems on some notifiers
2019-03-11 00:23:07 +01:00
Torkel Ödegaard
570187384b
Merge pull request #13825 from athurg/optimize_dingding_alert_message
Optimize dingding alert message
2019-03-08 15:33:24 +01:00
Marcus Efraimsson
8029e48588
support get user tokens/revoke all user tokens in UserTokenService 2019-03-08 15:15:17 +01:00
Marcus Efraimsson
e3b3062107
add nil/length check when delete old login attempts 2019-03-08 13:31:46 +01:00
bergquist
d99af23946 add garbage collector for database cache 2019-03-08 09:09:27 +01:00
bergquist
d4f5789660 cache: initial version of db cache 2019-03-08 09:09:27 +01:00
Marcus Efraimsson
f21c976b27
fix discord notifier so it doesn't crash when there are no image generated 2019-03-06 17:03:14 +01:00
Torkel Ödegaard
8ba4eb47e7
Merge pull request #15769 from grafana/15768_xorm_upgrade
upgrade xorm packages to latest versions
2019-03-06 15:11:06 +01:00
Marcus Efraimsson
36f3accf0d
log phantomjs output even if it timeout and include orgId when render alert 2019-03-06 13:53:23 +01:00
Marcus Efraimsson
f845a3b841
upgrade xorm packages to latest versions 2019-03-05 21:11:23 +01:00
Carl Bergquist
71bfefa8fb
Merge pull request #15608 from Maddin-619/fix-datasource-update
Fix Datasource Update to no User/Password
2019-03-05 14:38:32 +01:00
bergquist
ae9327ff3a remove UseBool since we use AllCols 2019-03-05 13:41:40 +01:00
Torkel Ödegaard
b4df0e73cd
Merge pull request #15706 from grafana/15656-playlists-with-tags-rebased
wip: Fix playlists "by tags"
2019-03-04 09:00:28 +00:00
Marcus Efraimsson
d49f0bedd3 fix: prevent datasource json data stored as nil (#15508)
prevent datasource json data stored as nil

closes #14239
2019-03-02 21:18:26 +01:00
Johannes Schill
8d5ccc7831 fix: Return url when query dashboards by tag 2019-02-28 10:44:39 +01:00
bergquist
8a3a3cccc3 moves metric package to /infra
ref #14679
2019-02-24 21:12:51 +01:00
Maddin-619
09cd173e92 updates all cols except created so user and password
of the database can be chaned to no user and password
2019-02-22 14:19:15 +01:00
bergquist
7754c37a1f reduce loglevel to debug 2019-02-19 08:22:33 +01:00
Torkel Ödegaard
1adc1a6097
Merge pull request #15455 from grafana/fixed-handling-of-alert-urls
Fixed handling of alert urls with true flags
2019-02-15 16:27:23 +01:00
Torkel Ödegaard
4c28ec83b3
Merge pull request #15444 from max-neverov/percent_diff_null
Fix percent_diff calculation when points are nulls
2019-02-15 13:03:19 +01:00
Torkel Ödegaard
7699706e65 fixed handling of alert urls with true flags, fixes #15454 2019-02-15 11:23:31 +01:00
Maxim Neverov
28eaac3a9c Extracted common code for diff calculation 2019-02-14 21:52:59 +01:00
Torkel Ödegaard
cd8f5835ec
Merge pull request #15395 from briangann/20190212_adjust_notifier_render_timeout
allow 90 percent of alertTimeout for rendering to complete vs 50 percent
2019-02-14 17:21:40 +01:00
Maxim Neverov
3c2f6094b2 Fix percent_diff calculation when points are nulls 2019-02-14 16:31:15 +01:00
Brian Gann
c98b00c302 allow 90 percent of alertTimeout for rendering to complete vs 50 percent 2019-02-13 09:56:37 -06:00
Carl Bergquist
dcec61e1b4
Merge pull request #15378 from grafana/auth_token_quotas
use authTokenService for session quotas restrictions
2019-02-12 15:38:57 +01:00
bergquist
e163aadfe4 use authtoken for session quota restrictions
closes #15360
2019-02-12 15:10:55 +01:00
bergquist
1310d356fc removes unused session code 2019-02-12 12:33:54 +01:00
Carl Bergquist
1f7a1f807e
Merge pull request #15299 from grafana/15295_fux
Make sure alert notifier provisioning directory are created for deb and rpm packages
2019-02-11 13:31:51 +01:00
bergquist
3ce99bca66 renames usage state name for auth token
as noted, sessions might not be a good name for this metrics.
while devices would be a better name for users I think we should
align the name with the code as much as possible. The ui listing
all auth_tokens per user should probarbly say "devices" instead
2019-02-11 11:08:31 +01:00
bergquist
2be60887ca adds usage stats for sessions 2019-02-07 16:27:40 +01:00
Marcus Efraimsson
b4267eafb8
log root cause error when reading from provisioning directories 2019-02-07 15:46:57 +01:00
bergquist
170783c292 make hourly cleanup the default behavior 2019-02-07 10:51:35 +01:00
Marcus Efraimsson
1a140ee199
run token cleanup job when grafana starts, then each hour 2019-02-06 22:27:08 +01:00
Marcus Efraimsson
8ae066ab5d
move authtoken package into auth package 2019-02-06 17:02:57 +01:00
Marcus Efraimsson
8678620730
move UserToken and UserTokenService to models package 2019-02-06 16:55:12 +01:00
Marcus Efraimsson
a60124a88c
change UserToken from interface to struct 2019-02-06 16:30:50 +01:00
Marcus Efraimsson
d8658a765c
enhanced expiration logic for lookup token
tokens are not expired if created_at > now - LoginMaxLifetimeDays and
rotated_at > now - LoginMaxInactiveLifetimeDays
2019-02-06 08:30:14 +01:00
Marcus Efraimsson
9483506590
auth token clean up job now runs on schedule and deletes all expired tokens
delete tokens having created_at <= LoginMaxLifetimeDays or
rotated_at <= LoginMaxInactiveLifetimeDays
2019-02-05 21:20:11 +01:00
Marcus Efraimsson
0915f931ae
change configuration settings in auth package 2019-02-05 21:12:30 +01:00
Marcus Efraimsson
7cd3cd6cd4
auth package refactoring
moving middleware/hooks away from package
exposing public struct UserToken accessible from other packages
fix debug log lines so the same order and naming are used
2019-02-05 00:10:56 +01:00
Marcus Efraimsson
fb3c510178
Merge branch 'master' into delete_session_on_logout 2019-02-04 20:23:05 +01:00
Marcus Efraimsson
d433ca7d40
fix util for splitting host and port
Now you can provide both a default host and a default port
2019-02-04 13:10:32 +01:00
Sean Lafferty
fa22311a95 base64 encode encrypted oauth token fields 2019-02-02 09:03:04 -05:00
Athurg Feng
70b23ab73b Add string quote func 2019-02-02 13:36:10 +08:00
Athurg Feng
bba92c0746 Remove option used to control within browser 2019-02-02 13:35:17 +08:00
Sean Lafferty
4a7cf82f5f Remove length from text columns 2019-02-01 19:45:27 -05:00
Sean Lafferty
5a59cdf0ef Add oauth pass-thru option for datasources 2019-02-01 19:40:57 -05:00
bergquist
a6bd2c73a0 introduce samesite setting for login cookie
ref #15067
2019-02-01 11:47:21 +01:00
bergquist
a1b3986532 always delete session cookie even if db delete fails 2019-02-01 09:59:53 +01:00
bergquist
91bd908e03 adds more tests signing out session 2019-01-31 22:24:04 +01:00
bergquist
11c4967bdc changes some info logging to debug 2019-01-31 21:51:14 +01:00
bergquist
88ca54eba9 renames signout function 2019-01-31 16:26:36 +01:00
bergquist
43ac79685a delete auth token on signout 2019-01-31 16:13:35 +01:00
Carl Bergquist
e2c2b70a61
Merge pull request #14852 from jpenalbae/pushover-attach
pushover: add support for attaching images (closes #10780)
2019-01-31 11:18:08 +01:00
Torkel Ödegaard
9a598be4f7 Fixed failing unit test 2019-01-29 21:17:56 +01:00
Torkel Ödegaard
416562bd90
Merge pull request #15102 from mjtrangoni/fix-golint-issues
Fix golint issues
2019-01-29 21:12:34 +01:00
Torkel Ödegaard
a2dd6f378f fixed sqlite issue introduced by #14709 2019-01-29 20:27:01 +01:00
Marcus Efraimsson
a067862a0a
Merge pull request #14709 from tpetr/extra-connection-string-args
add support for defining additonal database connection string args
2019-01-29 20:13:17 +01:00
Carl Bergquist
c6f80ecec2
Merge pull request #14229 from pbakulev/configurable-alert-notification
Configurable alert notification
2019-01-28 22:47:12 +01:00
Mario Trangoni
b7628f2060 pkg/util/{filepath.go,shortid_generator.go}: Fix golint issues
See,
$ gometalinter --vendor --deadline 10m --disable-all --enable=golint  ./...
filepath.go:12:5⚠️ error var WalkSkipDir should have name of the form ErrFoo (golint)
shortid_generator.go:11:5⚠️ var validUidPattern should be validUIDPattern (golint)
shortid_generator.go:19:6⚠️ func IsValidShortUid should be IsValidShortUID (golint)
shortid_generator.go:24:6⚠️ func GenerateShortUid should be GenerateShortUID (golint)
2019-01-28 22:37:44 +01:00
Mario Trangoni
8261613b51 pkg/util/{ip.go,url.go}: Fix some golint issues
See,
$ gometalinter --vendor --deadline 10m --disable-all --enable=golint  ./...
ip.go:8:6⚠️ func SplitIpPort should be SplitIPPort (golint)
url.go:14:6⚠️ func NewUrlQueryReader should be NewURLQueryReader (golint)
url.go:9:6⚠️ type UrlQueryReader should be URLQueryReader (golint)
url.go:37:6⚠️ func JoinUrlFragments should be JoinURLFragments (golint)
2019-01-28 22:29:20 +01:00
bergquist
e218cc7637 docs: updates docs to refer to using uid 2019-01-28 22:03:16 +01:00
bergquist
7c93335d28 gofmt issue 2019-01-28 21:04:08 +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
Marcus Efraimsson
ed6cca61c9
Merge pull request #15051 from ellisvlad/13711_parse_database_config_ipv6_host
Parse database host correctly when using IPv6
2019-01-28 18:32:09 +01:00
bergquist
21fff415ed removes unnessecary db request 2019-01-28 15:37:52 +01:00
bergquist
935da14f7d tab/spaces formatting 2019-01-28 15:27:02 +01:00
bergquist
6a8643b3d1 Merge branch 'master' into configurable-alert-notification
* master: (250 commits)
  Firing off an action instead of listening to location changes
  Changes after PR Comments
  Made ExplorerToolbar connected and refactored away responsabilities from Explore
  Removed some split complexity
  Fixed some more styling
  Fixed close split look and feel
  Fixed position of Closesplit
  Fixed small issue with TimePicker dropdown position
  Simplified some styles and dom elements
  Fixed some more with the sidemenu open and smaller screens
  Fixed so heading looks good with closed sidemenu
  Restructure of component and styling
  Refactored out ExploreToolbar from Explore
  Fixed reinitialise of Explore
  changelog: add notes about closing #13929
  changelog: add notes about closing #14558
  changelog: add notes about closing #14484
  changelog: add notes about closing #13765
  changelog: add notes about closing #11503
  changelog: add notes about closing #4075
  ...
2019-01-28 14:16:43 +01:00
bergquist
0cbc89b063 Merge branch 'master' into 14701-fix-alert-context
* master: (262 commits)
  pkg/services/dashboards/dashboard_service.go: simplify return
  Updated url query param encoding to exctly match angular encoding
  Updated snapshot
  Added missing props not being passed to scrollbar component, fixes #15058
  Document /api/health
  changelog: adds note for #15062
  change default rotate_token_minutes to 10 minutes
  fix
  load test/ha fixes
  set low login cookie rotate time in ha mode
  fix multiple piechart instances bug
  scripts/build/*: Fix some golint issues
  scripts/build/*: Fix golint issues Url => URL
  build: fixes building grafana completely within docker.
  dont specify domain for auth cookies
  New snapshot reflecting changes
  Makes the clickable side menu header look great in light theme again
  org id fix for load test
  user auth token load tests using k6.io
  moves cookie https setting to [security]
  ...
2019-01-28 08:09:52 +01:00
bergquist
364154d81f moves timeout tests to an integration test 2019-01-28 07:56:31 +01:00
Vlad Ellis
9692955d4f
Correct formatting of sqlstore_test.go 2019-01-27 16:28:02 +00:00
Mario Trangoni
bf90ff87cf pkg/services/dashboards/dashboard_service.go: simplify return
See,
$ gometalinter --vendor --deadline 10m --disable-all --enable=megacheck  ./...
pkg/services/dashboards/dashboard_service.go:167:2⚠️ 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013) (megacheck)
2019-01-26 14:23:10 +01:00
Vlad Ellis
c208186f26 Parse database host correctly when using IPv6 2019-01-25 21:56:19 +00:00
bergquist
75760aa892 dont specify domain for auth cookies 2019-01-25 10:40:50 +01:00
bergquist
d6edaa1328 moves cookie https setting to [security] 2019-01-24 19:04:58 +01:00
bergquist
516037fbdd makes sure rotation is always higher than urgent rotation 2019-01-24 13:54:45 +01:00
bergquist
fd0f9f2dd2 fixes broken test 2019-01-24 12:06:44 +01:00
bergquist
ff483f3782 removes old cookie auth configuration 2019-01-24 10:55:10 +01:00
bergquist
56a521b264 makes auth token rotation time configurable 2019-01-24 10:50:18 +01:00
bergquist
5998646da5 restrict session usage to auth_proxy 2019-01-23 14:56:48 +01:00
Carl Bergquist
766122856b
Merge pull request #14995 from bergquist/token_oauth
Stores hashed state code in cookie for OAuth logins.
2019-01-23 10:39:12 +01:00
bergquist
c3ff3d644c fixes nil ref in tests 2019-01-22 16:16:32 +01:00
bergquist
31b5db06f1 Merge branch 'master' into poc_token_auth
* master: (156 commits)
  Fixed issues with the sanitizie input in text panels, added docs, renamed config option
  build: removes arm32v6 docker image.
  Updated version in package.json to 6.0.0-pre1
  Update CHANGELOG.md
  build: armv6 docker image.
  build: skips building rpm for armv6.
  build: builds for armv6.
  Explore: mini styling fix for angular query editors
  Removed unused props & state in PromQueryField
  chore: Remove logging and use the updated config param
  chore: Reverse sanitize variable so it defaults to false
  feat: wip: Sanitize user input on text panel
  fix: Text panel should re-render when panel mode is changed #14922
  Minor rename of LogsProps and LogsState
  Splitted up LogLabels into LogLabelStats and LogLabel
  Refactored out LogRow to a separate file
  Removed strange edit
  Added link to side menu header and fixed styling
  Moved ValueMapping logic and tests to separate files
  Fixed data source selection in explore
  ...
2019-01-22 15:39:54 +01:00
bergquist
64124b5042 add setting for how to long we should keep expired tokens 2019-01-22 15:31:43 +01:00
bergquist
12f8338977 stores hashed state code in cookie 2019-01-22 15:22:24 +01:00
bergquist
d3ec8e1ccb creates new config section for login settings 2019-01-22 15:22:11 +01:00
Marcus Efraimsson
4096449aec
extract auth token interface and remove auth token from context 2019-01-22 12:00:33 +01:00
Marcus Efraimsson
366e356e08
more auth token tests 2019-01-21 21:48:18 +01:00
bergquist
777bd9ea18 adds cleanup job for old session tokens 2019-01-21 19:03:32 +01:00
Marcus Efraimsson
f040f9a400
fix tests after renaming now 2019-01-21 16:53:00 +01:00
Marcus Efraimsson
38efc1d7d2
s/print/log 2019-01-21 15:53:40 +01:00
bergquist
92620af75f avoid calling now() multiple times 2019-01-21 15:48:17 +01:00
Marcus Efraimsson
dd8476d81a
passing auth token tests 2019-01-21 15:06:33 +01:00
Marcus Efraimsson
565408194a
handle expired tokens 2019-01-21 13:22:20 +01:00
bergquist
697ddccd8e set userToken on request when logging in 2019-01-21 11:42:10 +01:00
bergquist
55b3013eb3 moves initWithToken to auth package 2019-01-21 11:37:44 +01:00
Marcus Efraimsson
734a7d38b2
set cookie name from configuration 2019-01-21 11:21:43 +01:00
Marcus Efraimsson
766cfab374
change rotate time 2019-01-21 10:22:18 +01:00
Marcus Efraimsson
0d1e3759eb
mixor fixes 2019-01-21 10:20:23 +01:00
bergquist
2e97d39abe removes commented code 2019-01-21 10:01:48 +01:00
bergquist
47a7d93fd9 moves rotation into auth since both happens before c.Next() 2019-01-21 08:59:01 +01:00
sharkpc0813
35013a28cd add timeout test for alert handling. 2019-01-18 11:23:00 +09:00
bergquist
fd937e3d95 remove maxage from session token 2019-01-17 21:03:27 +01:00
bergquist
c2accfa4c0 inital code for rotate 2019-01-17 17:11:52 +01:00
bergquist
aba6148c43 login users based on token cookie 2019-01-16 16:44:40 +01:00
Pavel Bakulev
f461d52004 Converted notification id to uid via fmt for old alert notification settings 2019-01-16 16:52:00 +02:00
Pavel Bakulev
2de32756c2 Returned id for alert notifications which were created without uid 2019-01-16 16:52:00 +02:00
Pavel Bakulev
4bcace567b Formatted errors to err 2019-01-16 16:50:00 +02:00
Pavel Bakulev
d0370ea7ad Using func InitNotifier for verifying notification settings 2019-01-16 16:50:00 +02:00
Pavel Bakulev
f132e929ce Added uid for alert notifications 2019-01-16 16:50:00 +02:00
Pavel Bakulev
6d1ec19fe9 Renamed validation funcs for alert notification 2019-01-16 16:45:42 +02:00
Pavel Bakulev
5c10a897f8 Instantiating notifiers from config before using 2019-01-16 16:45:42 +02:00
Pavel Bakulev
4fa45253cf Added orgName parameter for alert_notifications 2019-01-16 16:45:42 +02:00
Pavel Bakulev
6e3e9a337d Added alert_notification configuration 2019-01-16 16:45:42 +02:00