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

Side by Side Diff: tokenserver/appengine/impl/services/admin/adminsrv/service.go

Issue 2785973002: token-server: Add protos for new API for generating service account tokens. (Closed)
Patch Set: more nits Created 3 years, 4 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
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,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and 12 // See the License for the specific language governing permissions and
13 // limitations under the License. 13 // limitations under the License.
14 14
15 // Package adminsrv implements Admin API. 15 // Package adminsrv implements Admin API.
16 // 16 //
17 // Code defined here is either invoked by an administrator or by the service 17 // Code defined here is either invoked by an administrator or by the service
18 // itself (via cron jobs or task queues). 18 // itself (via cron jobs or task queues).
19 package adminsrv 19 package adminsrv
20 20
21 import ( 21 import (
22 "github.com/luci/luci-go/appengine/gaeauth/server/gaesigner" 22 "github.com/luci/luci-go/appengine/gaeauth/server/gaesigner"
23 23
24 "github.com/luci/luci-go/tokenserver/appengine/impl/certconfig" 24 "github.com/luci/luci-go/tokenserver/appengine/impl/certconfig"
25 "github.com/luci/luci-go/tokenserver/appengine/impl/delegation" 25 "github.com/luci/luci-go/tokenserver/appengine/impl/delegation"
26 "github.com/luci/luci-go/tokenserver/appengine/impl/machinetoken" 26 "github.com/luci/luci-go/tokenserver/appengine/impl/machinetoken"
27 "github.com/luci/luci-go/tokenserver/appengine/impl/serviceaccounts"
27 28
28 "github.com/luci/luci-go/tokenserver/api/admin/v1" 29 "github.com/luci/luci-go/tokenserver/api/admin/v1"
29 ) 30 )
30 31
31 // serverImpl implements admin.AdminServer RPC interface. 32 // serverImpl implements admin.AdminServer RPC interface.
32 type serverImpl struct { 33 type serverImpl struct {
33 certconfig.ImportCAConfigsRPC 34 certconfig.ImportCAConfigsRPC
34 delegation.ImportDelegationConfigsRPC 35 delegation.ImportDelegationConfigsRPC
36 serviceaccounts.ImportServiceAccountsConfigsRPC
35 machinetoken.InspectMachineTokenRPC 37 machinetoken.InspectMachineTokenRPC
36 delegation.InspectDelegationTokenRPC 38 delegation.InspectDelegationTokenRPC
39 serviceaccounts.InspectOAuthTokenGrantRPC
37 } 40 }
38 41
39 // NewServer returns prod AdminServer implementation. 42 // NewServer returns prod AdminServer implementation.
40 // 43 //
41 // It assumes authorization has happened already. 44 // It assumes authorization has happened already.
42 func NewServer() admin.AdminServer { 45 func NewServer() admin.AdminServer {
43 signer := gaesigner.Signer{} 46 signer := gaesigner.Signer{}
44 return &serverImpl{ 47 return &serverImpl{
45 ImportDelegationConfigsRPC: delegation.ImportDelegationConfigsRP C{ 48 ImportDelegationConfigsRPC: delegation.ImportDelegationConfigsRP C{
46 RulesCache: delegation.GlobalRulesCache, 49 RulesCache: delegation.GlobalRulesCache,
47 }, 50 },
48 InspectMachineTokenRPC: machinetoken.InspectMachineTokenRPC{ 51 InspectMachineTokenRPC: machinetoken.InspectMachineTokenRPC{
49 Signer: signer, 52 Signer: signer,
50 }, 53 },
51 InspectDelegationTokenRPC: delegation.InspectDelegationTokenRPC{ 54 InspectDelegationTokenRPC: delegation.InspectDelegationTokenRPC{
52 Signer: signer, 55 Signer: signer,
53 }, 56 },
54 } 57 }
55 } 58 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698