Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2861)

Unified Diff: appengine/gaeauth/server/default.go

Issue 1468053004: Add /auth/api/v1/server/info endpoints. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: add runtime version Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | server/auth/info/info.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/gaeauth/server/default.go
diff --git a/appengine/gaeauth/server/default.go b/appengine/gaeauth/server/default.go
index 8942e0e17db1d0fba121675f320434b714ba7b9a..5e485399669812076209f6fe73adce05bc5a5d01 100644
--- a/appengine/gaeauth/server/default.go
+++ b/appengine/gaeauth/server/default.go
@@ -5,12 +5,16 @@
package server
import (
+ "runtime"
+ "strings"
+
"github.com/julienschmidt/httprouter"
"golang.org/x/net/context"
"google.golang.org/appengine"
"github.com/luci/luci-go/server/auth"
"github.com/luci/luci-go/server/auth/admin"
+ "github.com/luci/luci-go/server/auth/info"
"github.com/luci/luci-go/server/auth/openid"
"github.com/luci/luci-go/server/auth/signing"
"github.com/luci/luci-go/server/middleware"
@@ -37,6 +41,7 @@ func InstallHandlers(r *httprouter.Router, base middleware.Base) {
admin.InstallHandlers(r, base, &UsersAPIAuthMethod{}, adminPagesConfig{})
auth.InstallHandlers(r, base)
authdb.InstallHandlers(r, base)
+ info.InstallHandlers(r, base, getServiceInfo)
signing.InstallHandlers(r, base)
}
@@ -49,6 +54,20 @@ func Warmup(c context.Context) error {
return nil
}
+func getServiceInfo(c context.Context) (info.ServiceInfo, error) {
+ account, err := appengine.ServiceAccount(c)
+ if err != nil {
+ return info.ServiceInfo{}, err
+ }
+ return info.ServiceInfo{
+ AppID: appengine.AppID(c),
+ AppRuntime: "go",
+ AppRuntimeVersion: runtime.Version(),
+ AppVersion: strings.Split(appengine.VersionID(c), ".")[0],
+ ServiceAccountName: account,
+ }, nil
+}
+
///
// adminPagesConfig is used by server/auth/admin to display admin UI
« no previous file with comments | « no previous file | server/auth/info/info.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698