From e9afd30b471ad34ba47073b05b548d25eafdfeb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 15 Apr 2015 10:31:56 +0200 Subject: [PATCH 1/3] Updated changelog with, Github OAuth: Now works with Github for Enterprise, thanks @williamjoy --- CHANGELOG.md | 5 +++++ conf/defaults.ini | 3 +-- pkg/setting/setting_oauth.go | 1 + pkg/social/social.go | 8 ++++---- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8289665907c..a97ed5e4319 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 2.0.0 (unreleased) + +**Fixes** +- [Issue #1782](https://github.com/grafana/grafana/issues/1782). Github OAuth: Now works with Github for Enterprise, thanks @williamjoy + # 2.0.0-Beta3 (2015-04-12) **RPM / DEB Package changes (to follow HFS)** diff --git a/conf/defaults.ini b/conf/defaults.ini index 5035941b2ec..1c158e97a10 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -142,8 +142,7 @@ scopes = user:email auth_url = https://github.com/login/oauth/authorize token_url = https://github.com/login/oauth/access_token api_url = https://api.github.com/user -# Uncomment bellow to only allow specific email domains -; allowed_domains = mycompany.com othercompany.com +allowed_domains = #################################### Google Auth ########################## [auth.google] diff --git a/pkg/setting/setting_oauth.go b/pkg/setting/setting_oauth.go index e833e534ff6..970958d1a8d 100644 --- a/pkg/setting/setting_oauth.go +++ b/pkg/setting/setting_oauth.go @@ -6,6 +6,7 @@ type OAuthInfo struct { AuthUrl, TokenUrl string Enabled bool AllowedDomains []string + ApiUrl string } type OAuther struct { diff --git a/pkg/social/social.go b/pkg/social/social.go index f75b98b4210..bfffdb616a0 100644 --- a/pkg/social/social.go +++ b/pkg/social/social.go @@ -49,7 +49,7 @@ func NewOAuthService() { Scopes: sec.Key("scopes").Strings(" "), AuthUrl: sec.Key("auth_url").String(), TokenUrl: sec.Key("token_url").String(), - APIUrl: sec.Key("api_url").String(), + ApiUrl: sec.Key("api_url").String(), Enabled: sec.Key("enabled").MustBool(), AllowedDomains: sec.Key("allowed_domains").Strings(" "), } @@ -73,7 +73,7 @@ func NewOAuthService() { // GitHub. if name == "github" { setting.OAuthService.GitHub = true - SocialMap["github"] = &SocialGithub{Config: &config, allowedDomains: info.AllowedDomains, APIUrl: info.APIUrl} + SocialMap["github"] = &SocialGithub{Config: &config, allowedDomains: info.AllowedDomains, ApiUrl: info.ApiUrl} } // Google. @@ -101,7 +101,7 @@ func isEmailAllowed(email string, allowedDomains []string) bool { type SocialGithub struct { *oauth2.Config allowedDomains []string - APIUrl []string + ApiUrl string } func (s *SocialGithub) Type() int { @@ -121,7 +121,7 @@ func (s *SocialGithub) UserInfo(token *oauth2.Token) (*BasicUserInfo, error) { var err error client := s.Client(oauth2.NoContext, token) - r, err := client.Get(s.APIUrl) + r, err := client.Get(s.ApiUrl) if err != nil { return nil, err } From 836e4b4911193dbbbe1d6251cefe97d01ba88310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 15 Apr 2015 10:39:03 +0200 Subject: [PATCH 2/3] Dashboard snapshot: Should not require login to view snapshot, Fixes #1780 --- CHANGELOG.md | 1 + pkg/api/api.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a97ed5e4319..e1b7f16eb83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ **Fixes** - [Issue #1782](https://github.com/grafana/grafana/issues/1782). Github OAuth: Now works with Github for Enterprise, thanks @williamjoy +- [Issue #1780](https://github.com/grafana/grafana/issues/1780). Dashboard snapshot: Should not require login to view snapshot, Fixes #1780 # 2.0.0-Beta3 (2015-04-12) diff --git a/pkg/api/api.go b/pkg/api/api.go index d66d6ae24ca..6482beb075c 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -43,7 +43,7 @@ func Register(r *macaron.Macaron) { // dashboard snapshots r.Post("/api/snapshots/", bind(m.CreateDashboardSnapshotCommand{}), CreateDashboardSnapshot) - r.Get("/dashboard/snapshots/*", Index) + r.Get("/dashboard/snapshot/*", Index) r.Get("/api/snapshots/:key", GetDashboardSnapshot) r.Get("/api/snapshots-delete/:key", DeleteDashboardSnapshot) From 53b1d6a5b238261f4d66ea7676e9d4528735fd9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 15 Apr 2015 10:52:09 +0200 Subject: [PATCH 3/3] Row editor: increased width of title field, Fixes #1755 --- public/app/partials/roweditor.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/partials/roweditor.html b/public/app/partials/roweditor.html index 177a8fd4ce5..243546392cc 100644 --- a/public/app/partials/roweditor.html +++ b/public/app/partials/roweditor.html @@ -18,7 +18,7 @@
- +