veyron/services/identity/identityd: Tweaks
(1) Do not print out the object name of the discharger service if
not discharger service is being run
(2) Print out the name of the extension in the "add caveats" form
Change-Id: I914f1e2c907e6ebc0100ad8f47eb58bc3a253de3
diff --git a/services/identity/googleoauth/handler.go b/services/identity/googleoauth/handler.go
index 53fa571..b8b805b 100644
--- a/services/identity/googleoauth/handler.go
+++ b/services/identity/googleoauth/handler.go
@@ -57,7 +57,7 @@
listBlessingsCallbackRoute = "listblessingscallback"
revokeRoute = "revoke"
SeekBlessingsRoute = "seekblessings"
- addCaveatsRoute = "addcaveat"
+ addCaveatsRoute = "addcaveats"
sendMacaroonRoute = "sendmacaroon"
)
@@ -322,13 +322,14 @@
}
func (h *handler) seekBlessings(w http.ResponseWriter, r *http.Request) {
- if _, err := validLoopbackURL(r.FormValue("redirect_url")); err != nil {
+ redirect := r.FormValue("redirect_url")
+ if _, err := validLoopbackURL(redirect); err != nil {
vlog.Infof("seekBlessings failed: invalid redirect_url: %v", err)
util.HTTPBadRequest(w, r, fmt.Errorf("invalid redirect_url: %v", err))
return
}
outputMacaroon, err := h.csrfCop.NewToken(w, r, clientIDCookie, seekBlessingsMacaroon{
- RedirectURL: r.FormValue("redirect_url"),
+ RedirectURL: redirect,
State: r.FormValue("state"),
})
if err != nil {
@@ -369,9 +370,10 @@
return
}
tmplargs := struct {
+ Extension string
CaveatMap map[string]caveatInfo
Macaroon, MacaroonRoute string
- }{caveatMap, outputMacaroon, sendMacaroonRoute}
+ }{email, caveatMap, outputMacaroon, sendMacaroonRoute}
w.Header().Set("Context-Type", "text/html")
if err := tmplSelectCaveats.Execute(w, tmplargs); err != nil {
vlog.Errorf("Unable to execute bless page template: %v", err)
diff --git a/services/identity/googleoauth/template.go b/services/identity/googleoauth/template.go
index d203858..f79b5bf 100644
--- a/services/identity/googleoauth/template.go
+++ b/services/identity/googleoauth/template.go
@@ -113,7 +113,7 @@
<html>
<head>
<meta charset="UTF-8">
-<title>Veyron Identity Derivation</title>
+<title>Blessings: Select caveats</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
@@ -151,7 +151,7 @@
</head>
<body class="container">
<form class="form-signin" method="POST" name="input" action="/google/{{.MacaroonRoute}}">
-<h2 class="form-signin-heading">Select Caveats</h2>
+<h2 class="form-signin-heading">Select Caveats on {{.Extension}}</h2>
<input type="text" class="hidden" name="macaroon" value="{{.Macaroon}}">
<div class="caveatRow row">
<br/>
diff --git a/services/identity/identityd/main.go b/services/identity/identityd/main.go
index 24ec2d9..eef94c2 100644
--- a/services/identity/identityd/main.go
+++ b/services/identity/identityd/main.go
@@ -119,9 +119,11 @@
GoogleServers, DischargeServers []string
ListBlessingsRoute string
}{
- Self: rt.R().Identity().PublicID(),
- RandomWeb: enableRandomHandler(),
- DischargeServers: appendSuffixTo(published, dischargerService),
+ Self: rt.R().Identity().PublicID(),
+ RandomWeb: enableRandomHandler(),
+ }
+ if revocationManager != nil {
+ args.DischargeServers = appendSuffixTo(published, dischargerService)
}
if len(*googleConfigChrome) > 0 || len(*googleConfigAndroid) > 0 {
args.GoogleServers = appendSuffixTo(published, googleService)