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

Unified Diff: tokenserver/appengine/impl/certconfig/ca.go

Issue 2779323002: token-server: Warmup some local caches in /_ah/warmup. (Closed)
Patch Set: also warmup delegation config Created 3 years, 9 months 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 | « tokenserver/appengine/impl/certchecker/warmup.go ('k') | tokenserver/appengine/impl/certconfig/ca_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tokenserver/appengine/impl/certconfig/ca.go
diff --git a/tokenserver/appengine/impl/certconfig/ca.go b/tokenserver/appengine/impl/certconfig/ca.go
index 04f7c7884837c07de0ed5b07e0cf53b37ab47c64..f2c1684afad13dd2ac7fdb270b6aa163a200418a 100644
--- a/tokenserver/appengine/impl/certconfig/ca.go
+++ b/tokenserver/appengine/impl/certconfig/ca.go
@@ -71,6 +71,20 @@ func (c *CA) ParseConfig() (*admin.CertificateAuthorityConfig, error) {
return msg, nil
}
+// ListCAs returns names of all currently active CAs, in no particular order.
+func ListCAs(c context.Context) ([]string, error) {
+ keys := []*ds.Key{}
+ q := ds.NewQuery("CA").Eq("Removed", false).KeysOnly(true)
+ if err := ds.GetAll(c, q, &keys); err != nil {
+ return nil, errors.WrapTransient(err)
+ }
+ names := make([]string, len(keys))
+ for i, key := range keys {
+ names[i] = key.StringID()
+ }
+ return names, nil
+}
+
// CAUniqueIDToCNMap is a singleton entity that stores a mapping between CA's
// unique_id (specified in config) and its Common Name.
//
« no previous file with comments | « tokenserver/appengine/impl/certchecker/warmup.go ('k') | tokenserver/appengine/impl/certconfig/ca_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698