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

Side by Side Diff: server/auth/config.go

Issue 2983513002: gitiles.Log: implement paging. (Closed)
Patch Set: fix Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « milo/git/history.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The LUCI Authors. 1 // Copyright 2016 The LUCI Authors.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 14 matching lines...) Expand all
25 "github.com/luci/luci-go/server/auth/signing" 25 "github.com/luci/luci-go/server/auth/signing"
26 ) 26 )
27 27
28 // Config contains global configuration of the auth library. 28 // Config contains global configuration of the auth library.
29 // 29 //
30 // This configuration adjusts the library to the particular execution 30 // This configuration adjusts the library to the particular execution
31 // environment (GAE, Flex, whatever). It contains concrete implementations of 31 // environment (GAE, Flex, whatever). It contains concrete implementations of
32 // various interfaces used by the library. 32 // various interfaces used by the library.
33 // 33 //
34 // It lives in the context and must be installed there by some root middleware 34 // It lives in the context and must be installed there by some root middleware
35 // (via ModifyContext call). 35 // (via ModifyConfig call).
36 type Config struct { 36 type Config struct {
37 // DBProvider is a callback that returns most recent DB instance. 37 // DBProvider is a callback that returns most recent DB instance.
38 // 38 //
39 // DB represents a snapshot of user groups used for authorization checks . 39 // DB represents a snapshot of user groups used for authorization checks .
40 DBProvider func(c context.Context) (authdb.DB, error) 40 DBProvider func(c context.Context) (authdb.DB, error)
41 41
42 // Signer possesses the service's private key and can sign blobs with it . 42 // Signer possesses the service's private key and can sign blobs with it .
43 // 43 //
44 // It provides the bundle with corresponding public keys and information about 44 // It provides the bundle with corresponding public keys and information about
45 // the service account they belong too (the service's own identity). 45 // the service account they belong too (the service's own identity).
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // 120 //
121 // If no factory is installed, returns DB that forbids everything and logs 121 // If no factory is installed, returns DB that forbids everything and logs
122 // errors. It is often good enough for unit tests that do not care about 122 // errors. It is often good enough for unit tests that do not care about
123 // authorization, and still not horribly bad if accidentally used in production. 123 // authorization, and still not horribly bad if accidentally used in production.
124 func GetDB(c context.Context) (authdb.DB, error) { 124 func GetDB(c context.Context) (authdb.DB, error) {
125 if cfg := getConfig(c); cfg != nil && cfg.DBProvider != nil { 125 if cfg := getConfig(c); cfg != nil && cfg.DBProvider != nil {
126 return cfg.DBProvider(c) 126 return cfg.DBProvider(c)
127 } 127 }
128 return authdb.ErroringDB{Error: ErrNotConfigured}, nil 128 return authdb.ErroringDB{Error: ErrNotConfigured}, nil
129 } 129 }
OLDNEW
« no previous file with comments | « milo/git/history.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698