ca.pb.go 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: github.com/docker/swarmkit/api/ca.proto
  3. /*
  4. Package api is a generated protocol buffer package.
  5. It is generated from these files:
  6. github.com/docker/swarmkit/api/ca.proto
  7. github.com/docker/swarmkit/api/control.proto
  8. github.com/docker/swarmkit/api/dispatcher.proto
  9. github.com/docker/swarmkit/api/health.proto
  10. github.com/docker/swarmkit/api/logbroker.proto
  11. github.com/docker/swarmkit/api/objects.proto
  12. github.com/docker/swarmkit/api/raft.proto
  13. github.com/docker/swarmkit/api/resource.proto
  14. github.com/docker/swarmkit/api/snapshot.proto
  15. github.com/docker/swarmkit/api/specs.proto
  16. github.com/docker/swarmkit/api/types.proto
  17. github.com/docker/swarmkit/api/watch.proto
  18. It has these top-level messages:
  19. NodeCertificateStatusRequest
  20. NodeCertificateStatusResponse
  21. IssueNodeCertificateRequest
  22. IssueNodeCertificateResponse
  23. GetRootCACertificateRequest
  24. GetRootCACertificateResponse
  25. GetUnlockKeyRequest
  26. GetUnlockKeyResponse
  27. GetNodeRequest
  28. GetNodeResponse
  29. ListNodesRequest
  30. ListNodesResponse
  31. UpdateNodeRequest
  32. UpdateNodeResponse
  33. RemoveNodeRequest
  34. RemoveNodeResponse
  35. GetTaskRequest
  36. GetTaskResponse
  37. RemoveTaskRequest
  38. RemoveTaskResponse
  39. ListTasksRequest
  40. ListTasksResponse
  41. CreateServiceRequest
  42. CreateServiceResponse
  43. GetServiceRequest
  44. GetServiceResponse
  45. UpdateServiceRequest
  46. UpdateServiceResponse
  47. RemoveServiceRequest
  48. RemoveServiceResponse
  49. ListServicesRequest
  50. ListServicesResponse
  51. CreateNetworkRequest
  52. CreateNetworkResponse
  53. GetNetworkRequest
  54. GetNetworkResponse
  55. RemoveNetworkRequest
  56. RemoveNetworkResponse
  57. ListNetworksRequest
  58. ListNetworksResponse
  59. GetClusterRequest
  60. GetClusterResponse
  61. ListClustersRequest
  62. ListClustersResponse
  63. KeyRotation
  64. UpdateClusterRequest
  65. UpdateClusterResponse
  66. GetSecretRequest
  67. GetSecretResponse
  68. UpdateSecretRequest
  69. UpdateSecretResponse
  70. ListSecretsRequest
  71. ListSecretsResponse
  72. CreateSecretRequest
  73. CreateSecretResponse
  74. RemoveSecretRequest
  75. RemoveSecretResponse
  76. GetConfigRequest
  77. GetConfigResponse
  78. UpdateConfigRequest
  79. UpdateConfigResponse
  80. ListConfigsRequest
  81. ListConfigsResponse
  82. CreateConfigRequest
  83. CreateConfigResponse
  84. RemoveConfigRequest
  85. RemoveConfigResponse
  86. SessionRequest
  87. SessionMessage
  88. HeartbeatRequest
  89. HeartbeatResponse
  90. UpdateTaskStatusRequest
  91. UpdateTaskStatusResponse
  92. TasksRequest
  93. TasksMessage
  94. AssignmentsRequest
  95. Assignment
  96. AssignmentChange
  97. AssignmentsMessage
  98. HealthCheckRequest
  99. HealthCheckResponse
  100. LogSubscriptionOptions
  101. LogSelector
  102. LogContext
  103. LogAttr
  104. LogMessage
  105. SubscribeLogsRequest
  106. SubscribeLogsMessage
  107. ListenSubscriptionsRequest
  108. SubscriptionMessage
  109. PublishLogsMessage
  110. PublishLogsResponse
  111. Meta
  112. Node
  113. Service
  114. Endpoint
  115. Task
  116. NetworkAttachment
  117. Network
  118. Cluster
  119. Secret
  120. Config
  121. Resource
  122. Extension
  123. RaftMember
  124. JoinRequest
  125. JoinResponse
  126. LeaveRequest
  127. LeaveResponse
  128. ProcessRaftMessageRequest
  129. ProcessRaftMessageResponse
  130. StreamRaftMessageRequest
  131. StreamRaftMessageResponse
  132. ResolveAddressRequest
  133. ResolveAddressResponse
  134. InternalRaftRequest
  135. StoreAction
  136. AttachNetworkRequest
  137. AttachNetworkResponse
  138. DetachNetworkRequest
  139. DetachNetworkResponse
  140. StoreSnapshot
  141. ClusterSnapshot
  142. Snapshot
  143. NodeSpec
  144. ServiceSpec
  145. ReplicatedService
  146. GlobalService
  147. TaskSpec
  148. ResourceReference
  149. GenericRuntimeSpec
  150. NetworkAttachmentSpec
  151. ContainerSpec
  152. EndpointSpec
  153. NetworkSpec
  154. ClusterSpec
  155. SecretSpec
  156. ConfigSpec
  157. Version
  158. IndexEntry
  159. Annotations
  160. NamedGenericResource
  161. DiscreteGenericResource
  162. GenericResource
  163. Resources
  164. ResourceRequirements
  165. Platform
  166. PluginDescription
  167. EngineDescription
  168. NodeDescription
  169. NodeTLSInfo
  170. RaftMemberStatus
  171. NodeStatus
  172. Image
  173. Mount
  174. RestartPolicy
  175. UpdateConfig
  176. UpdateStatus
  177. ContainerStatus
  178. PortStatus
  179. TaskStatus
  180. NetworkAttachmentConfig
  181. IPAMConfig
  182. PortConfig
  183. Driver
  184. IPAMOptions
  185. Peer
  186. WeightedPeer
  187. IssuanceStatus
  188. AcceptancePolicy
  189. ExternalCA
  190. CAConfig
  191. OrchestrationConfig
  192. TaskDefaults
  193. DispatcherConfig
  194. RaftConfig
  195. EncryptionConfig
  196. SpreadOver
  197. PlacementPreference
  198. Placement
  199. JoinTokens
  200. RootCA
  201. Certificate
  202. EncryptionKey
  203. ManagerStatus
  204. FileTarget
  205. RuntimeTarget
  206. SecretReference
  207. ConfigReference
  208. BlacklistedCertificate
  209. HealthConfig
  210. MaybeEncryptedRecord
  211. RootRotation
  212. Privileges
  213. Object
  214. SelectBySlot
  215. SelectByCustom
  216. SelectBy
  217. WatchRequest
  218. WatchMessage
  219. */
  220. package api
  221. import proto "github.com/gogo/protobuf/proto"
  222. import fmt "fmt"
  223. import math "math"
  224. import _ "github.com/gogo/protobuf/gogoproto"
  225. import _ "github.com/docker/swarmkit/protobuf/plugin"
  226. import deepcopy "github.com/docker/swarmkit/api/deepcopy"
  227. import context "golang.org/x/net/context"
  228. import grpc "google.golang.org/grpc"
  229. import raftselector "github.com/docker/swarmkit/manager/raftselector"
  230. import codes "google.golang.org/grpc/codes"
  231. import status "google.golang.org/grpc/status"
  232. import metadata "google.golang.org/grpc/metadata"
  233. import peer "google.golang.org/grpc/peer"
  234. import rafttime "time"
  235. import strings "strings"
  236. import reflect "reflect"
  237. import io "io"
  238. // Reference imports to suppress errors if they are not otherwise used.
  239. var _ = proto.Marshal
  240. var _ = fmt.Errorf
  241. var _ = math.Inf
  242. // This is a compile-time assertion to ensure that this generated file
  243. // is compatible with the proto package it is being compiled against.
  244. // A compilation error at this line likely means your copy of the
  245. // proto package needs to be updated.
  246. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
  247. type NodeCertificateStatusRequest struct {
  248. NodeID string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`
  249. }
  250. func (m *NodeCertificateStatusRequest) Reset() { *m = NodeCertificateStatusRequest{} }
  251. func (*NodeCertificateStatusRequest) ProtoMessage() {}
  252. func (*NodeCertificateStatusRequest) Descriptor() ([]byte, []int) { return fileDescriptorCa, []int{0} }
  253. type NodeCertificateStatusResponse struct {
  254. Status *IssuanceStatus `protobuf:"bytes,1,opt,name=status" json:"status,omitempty"`
  255. Certificate *Certificate `protobuf:"bytes,2,opt,name=certificate" json:"certificate,omitempty"`
  256. }
  257. func (m *NodeCertificateStatusResponse) Reset() { *m = NodeCertificateStatusResponse{} }
  258. func (*NodeCertificateStatusResponse) ProtoMessage() {}
  259. func (*NodeCertificateStatusResponse) Descriptor() ([]byte, []int) { return fileDescriptorCa, []int{1} }
  260. type IssueNodeCertificateRequest struct {
  261. // DEPRECATED: Role is now selected based on which secret is matched.
  262. Role NodeRole `protobuf:"varint,1,opt,name=role,proto3,enum=docker.swarmkit.v1.NodeRole" json:"role,omitempty"`
  263. // CSR is the certificate signing request.
  264. CSR []byte `protobuf:"bytes,2,opt,name=csr,proto3" json:"csr,omitempty"`
  265. // Token represents a user-provided string that is necessary for new
  266. // nodes to join the cluster
  267. Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
  268. // Availability allows a user to control the current scheduling status of a node
  269. Availability NodeSpec_Availability `protobuf:"varint,4,opt,name=availability,proto3,enum=docker.swarmkit.v1.NodeSpec_Availability" json:"availability,omitempty"`
  270. }
  271. func (m *IssueNodeCertificateRequest) Reset() { *m = IssueNodeCertificateRequest{} }
  272. func (*IssueNodeCertificateRequest) ProtoMessage() {}
  273. func (*IssueNodeCertificateRequest) Descriptor() ([]byte, []int) { return fileDescriptorCa, []int{2} }
  274. type IssueNodeCertificateResponse struct {
  275. NodeID string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`
  276. NodeMembership NodeSpec_Membership `protobuf:"varint,2,opt,name=node_membership,json=nodeMembership,proto3,enum=docker.swarmkit.v1.NodeSpec_Membership" json:"node_membership,omitempty"`
  277. }
  278. func (m *IssueNodeCertificateResponse) Reset() { *m = IssueNodeCertificateResponse{} }
  279. func (*IssueNodeCertificateResponse) ProtoMessage() {}
  280. func (*IssueNodeCertificateResponse) Descriptor() ([]byte, []int) { return fileDescriptorCa, []int{3} }
  281. type GetRootCACertificateRequest struct {
  282. }
  283. func (m *GetRootCACertificateRequest) Reset() { *m = GetRootCACertificateRequest{} }
  284. func (*GetRootCACertificateRequest) ProtoMessage() {}
  285. func (*GetRootCACertificateRequest) Descriptor() ([]byte, []int) { return fileDescriptorCa, []int{4} }
  286. type GetRootCACertificateResponse struct {
  287. Certificate []byte `protobuf:"bytes,1,opt,name=certificate,proto3" json:"certificate,omitempty"`
  288. }
  289. func (m *GetRootCACertificateResponse) Reset() { *m = GetRootCACertificateResponse{} }
  290. func (*GetRootCACertificateResponse) ProtoMessage() {}
  291. func (*GetRootCACertificateResponse) Descriptor() ([]byte, []int) { return fileDescriptorCa, []int{5} }
  292. type GetUnlockKeyRequest struct {
  293. }
  294. func (m *GetUnlockKeyRequest) Reset() { *m = GetUnlockKeyRequest{} }
  295. func (*GetUnlockKeyRequest) ProtoMessage() {}
  296. func (*GetUnlockKeyRequest) Descriptor() ([]byte, []int) { return fileDescriptorCa, []int{6} }
  297. type GetUnlockKeyResponse struct {
  298. UnlockKey []byte `protobuf:"bytes,1,opt,name=unlock_key,json=unlockKey,proto3" json:"unlock_key,omitempty"`
  299. Version Version `protobuf:"bytes,2,opt,name=version" json:"version"`
  300. }
  301. func (m *GetUnlockKeyResponse) Reset() { *m = GetUnlockKeyResponse{} }
  302. func (*GetUnlockKeyResponse) ProtoMessage() {}
  303. func (*GetUnlockKeyResponse) Descriptor() ([]byte, []int) { return fileDescriptorCa, []int{7} }
  304. func init() {
  305. proto.RegisterType((*NodeCertificateStatusRequest)(nil), "docker.swarmkit.v1.NodeCertificateStatusRequest")
  306. proto.RegisterType((*NodeCertificateStatusResponse)(nil), "docker.swarmkit.v1.NodeCertificateStatusResponse")
  307. proto.RegisterType((*IssueNodeCertificateRequest)(nil), "docker.swarmkit.v1.IssueNodeCertificateRequest")
  308. proto.RegisterType((*IssueNodeCertificateResponse)(nil), "docker.swarmkit.v1.IssueNodeCertificateResponse")
  309. proto.RegisterType((*GetRootCACertificateRequest)(nil), "docker.swarmkit.v1.GetRootCACertificateRequest")
  310. proto.RegisterType((*GetRootCACertificateResponse)(nil), "docker.swarmkit.v1.GetRootCACertificateResponse")
  311. proto.RegisterType((*GetUnlockKeyRequest)(nil), "docker.swarmkit.v1.GetUnlockKeyRequest")
  312. proto.RegisterType((*GetUnlockKeyResponse)(nil), "docker.swarmkit.v1.GetUnlockKeyResponse")
  313. }
  314. type authenticatedWrapperCAServer struct {
  315. local CAServer
  316. authorize func(context.Context, []string) error
  317. }
  318. func NewAuthenticatedWrapperCAServer(local CAServer, authorize func(context.Context, []string) error) CAServer {
  319. return &authenticatedWrapperCAServer{
  320. local: local,
  321. authorize: authorize,
  322. }
  323. }
  324. func (p *authenticatedWrapperCAServer) GetRootCACertificate(ctx context.Context, r *GetRootCACertificateRequest) (*GetRootCACertificateResponse, error) {
  325. return p.local.GetRootCACertificate(ctx, r)
  326. }
  327. func (p *authenticatedWrapperCAServer) GetUnlockKey(ctx context.Context, r *GetUnlockKeyRequest) (*GetUnlockKeyResponse, error) {
  328. if err := p.authorize(ctx, []string{"swarm-manager"}); err != nil {
  329. return nil, err
  330. }
  331. return p.local.GetUnlockKey(ctx, r)
  332. }
  333. type authenticatedWrapperNodeCAServer struct {
  334. local NodeCAServer
  335. authorize func(context.Context, []string) error
  336. }
  337. func NewAuthenticatedWrapperNodeCAServer(local NodeCAServer, authorize func(context.Context, []string) error) NodeCAServer {
  338. return &authenticatedWrapperNodeCAServer{
  339. local: local,
  340. authorize: authorize,
  341. }
  342. }
  343. func (p *authenticatedWrapperNodeCAServer) IssueNodeCertificate(ctx context.Context, r *IssueNodeCertificateRequest) (*IssueNodeCertificateResponse, error) {
  344. return p.local.IssueNodeCertificate(ctx, r)
  345. }
  346. func (p *authenticatedWrapperNodeCAServer) NodeCertificateStatus(ctx context.Context, r *NodeCertificateStatusRequest) (*NodeCertificateStatusResponse, error) {
  347. return p.local.NodeCertificateStatus(ctx, r)
  348. }
  349. func (m *NodeCertificateStatusRequest) Copy() *NodeCertificateStatusRequest {
  350. if m == nil {
  351. return nil
  352. }
  353. o := &NodeCertificateStatusRequest{}
  354. o.CopyFrom(m)
  355. return o
  356. }
  357. func (m *NodeCertificateStatusRequest) CopyFrom(src interface{}) {
  358. o := src.(*NodeCertificateStatusRequest)
  359. *m = *o
  360. }
  361. func (m *NodeCertificateStatusResponse) Copy() *NodeCertificateStatusResponse {
  362. if m == nil {
  363. return nil
  364. }
  365. o := &NodeCertificateStatusResponse{}
  366. o.CopyFrom(m)
  367. return o
  368. }
  369. func (m *NodeCertificateStatusResponse) CopyFrom(src interface{}) {
  370. o := src.(*NodeCertificateStatusResponse)
  371. *m = *o
  372. if o.Status != nil {
  373. m.Status = &IssuanceStatus{}
  374. deepcopy.Copy(m.Status, o.Status)
  375. }
  376. if o.Certificate != nil {
  377. m.Certificate = &Certificate{}
  378. deepcopy.Copy(m.Certificate, o.Certificate)
  379. }
  380. }
  381. func (m *IssueNodeCertificateRequest) Copy() *IssueNodeCertificateRequest {
  382. if m == nil {
  383. return nil
  384. }
  385. o := &IssueNodeCertificateRequest{}
  386. o.CopyFrom(m)
  387. return o
  388. }
  389. func (m *IssueNodeCertificateRequest) CopyFrom(src interface{}) {
  390. o := src.(*IssueNodeCertificateRequest)
  391. *m = *o
  392. if o.CSR != nil {
  393. m.CSR = make([]byte, len(o.CSR))
  394. copy(m.CSR, o.CSR)
  395. }
  396. }
  397. func (m *IssueNodeCertificateResponse) Copy() *IssueNodeCertificateResponse {
  398. if m == nil {
  399. return nil
  400. }
  401. o := &IssueNodeCertificateResponse{}
  402. o.CopyFrom(m)
  403. return o
  404. }
  405. func (m *IssueNodeCertificateResponse) CopyFrom(src interface{}) {
  406. o := src.(*IssueNodeCertificateResponse)
  407. *m = *o
  408. }
  409. func (m *GetRootCACertificateRequest) Copy() *GetRootCACertificateRequest {
  410. if m == nil {
  411. return nil
  412. }
  413. o := &GetRootCACertificateRequest{}
  414. o.CopyFrom(m)
  415. return o
  416. }
  417. func (m *GetRootCACertificateRequest) CopyFrom(src interface{}) {}
  418. func (m *GetRootCACertificateResponse) Copy() *GetRootCACertificateResponse {
  419. if m == nil {
  420. return nil
  421. }
  422. o := &GetRootCACertificateResponse{}
  423. o.CopyFrom(m)
  424. return o
  425. }
  426. func (m *GetRootCACertificateResponse) CopyFrom(src interface{}) {
  427. o := src.(*GetRootCACertificateResponse)
  428. *m = *o
  429. if o.Certificate != nil {
  430. m.Certificate = make([]byte, len(o.Certificate))
  431. copy(m.Certificate, o.Certificate)
  432. }
  433. }
  434. func (m *GetUnlockKeyRequest) Copy() *GetUnlockKeyRequest {
  435. if m == nil {
  436. return nil
  437. }
  438. o := &GetUnlockKeyRequest{}
  439. o.CopyFrom(m)
  440. return o
  441. }
  442. func (m *GetUnlockKeyRequest) CopyFrom(src interface{}) {}
  443. func (m *GetUnlockKeyResponse) Copy() *GetUnlockKeyResponse {
  444. if m == nil {
  445. return nil
  446. }
  447. o := &GetUnlockKeyResponse{}
  448. o.CopyFrom(m)
  449. return o
  450. }
  451. func (m *GetUnlockKeyResponse) CopyFrom(src interface{}) {
  452. o := src.(*GetUnlockKeyResponse)
  453. *m = *o
  454. if o.UnlockKey != nil {
  455. m.UnlockKey = make([]byte, len(o.UnlockKey))
  456. copy(m.UnlockKey, o.UnlockKey)
  457. }
  458. deepcopy.Copy(&m.Version, &o.Version)
  459. }
  460. // Reference imports to suppress errors if they are not otherwise used.
  461. var _ context.Context
  462. var _ grpc.ClientConn
  463. // This is a compile-time assertion to ensure that this generated file
  464. // is compatible with the grpc package it is being compiled against.
  465. const _ = grpc.SupportPackageIsVersion4
  466. // Client API for CA service
  467. type CAClient interface {
  468. GetRootCACertificate(ctx context.Context, in *GetRootCACertificateRequest, opts ...grpc.CallOption) (*GetRootCACertificateResponse, error)
  469. // GetUnlockKey returns the current unlock key for the cluster for the role of the client
  470. // asking.
  471. GetUnlockKey(ctx context.Context, in *GetUnlockKeyRequest, opts ...grpc.CallOption) (*GetUnlockKeyResponse, error)
  472. }
  473. type cAClient struct {
  474. cc *grpc.ClientConn
  475. }
  476. func NewCAClient(cc *grpc.ClientConn) CAClient {
  477. return &cAClient{cc}
  478. }
  479. func (c *cAClient) GetRootCACertificate(ctx context.Context, in *GetRootCACertificateRequest, opts ...grpc.CallOption) (*GetRootCACertificateResponse, error) {
  480. out := new(GetRootCACertificateResponse)
  481. err := grpc.Invoke(ctx, "/docker.swarmkit.v1.CA/GetRootCACertificate", in, out, c.cc, opts...)
  482. if err != nil {
  483. return nil, err
  484. }
  485. return out, nil
  486. }
  487. func (c *cAClient) GetUnlockKey(ctx context.Context, in *GetUnlockKeyRequest, opts ...grpc.CallOption) (*GetUnlockKeyResponse, error) {
  488. out := new(GetUnlockKeyResponse)
  489. err := grpc.Invoke(ctx, "/docker.swarmkit.v1.CA/GetUnlockKey", in, out, c.cc, opts...)
  490. if err != nil {
  491. return nil, err
  492. }
  493. return out, nil
  494. }
  495. // Server API for CA service
  496. type CAServer interface {
  497. GetRootCACertificate(context.Context, *GetRootCACertificateRequest) (*GetRootCACertificateResponse, error)
  498. // GetUnlockKey returns the current unlock key for the cluster for the role of the client
  499. // asking.
  500. GetUnlockKey(context.Context, *GetUnlockKeyRequest) (*GetUnlockKeyResponse, error)
  501. }
  502. func RegisterCAServer(s *grpc.Server, srv CAServer) {
  503. s.RegisterService(&_CA_serviceDesc, srv)
  504. }
  505. func _CA_GetRootCACertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  506. in := new(GetRootCACertificateRequest)
  507. if err := dec(in); err != nil {
  508. return nil, err
  509. }
  510. if interceptor == nil {
  511. return srv.(CAServer).GetRootCACertificate(ctx, in)
  512. }
  513. info := &grpc.UnaryServerInfo{
  514. Server: srv,
  515. FullMethod: "/docker.swarmkit.v1.CA/GetRootCACertificate",
  516. }
  517. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  518. return srv.(CAServer).GetRootCACertificate(ctx, req.(*GetRootCACertificateRequest))
  519. }
  520. return interceptor(ctx, in, info, handler)
  521. }
  522. func _CA_GetUnlockKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  523. in := new(GetUnlockKeyRequest)
  524. if err := dec(in); err != nil {
  525. return nil, err
  526. }
  527. if interceptor == nil {
  528. return srv.(CAServer).GetUnlockKey(ctx, in)
  529. }
  530. info := &grpc.UnaryServerInfo{
  531. Server: srv,
  532. FullMethod: "/docker.swarmkit.v1.CA/GetUnlockKey",
  533. }
  534. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  535. return srv.(CAServer).GetUnlockKey(ctx, req.(*GetUnlockKeyRequest))
  536. }
  537. return interceptor(ctx, in, info, handler)
  538. }
  539. var _CA_serviceDesc = grpc.ServiceDesc{
  540. ServiceName: "docker.swarmkit.v1.CA",
  541. HandlerType: (*CAServer)(nil),
  542. Methods: []grpc.MethodDesc{
  543. {
  544. MethodName: "GetRootCACertificate",
  545. Handler: _CA_GetRootCACertificate_Handler,
  546. },
  547. {
  548. MethodName: "GetUnlockKey",
  549. Handler: _CA_GetUnlockKey_Handler,
  550. },
  551. },
  552. Streams: []grpc.StreamDesc{},
  553. Metadata: "github.com/docker/swarmkit/api/ca.proto",
  554. }
  555. // Client API for NodeCA service
  556. type NodeCAClient interface {
  557. IssueNodeCertificate(ctx context.Context, in *IssueNodeCertificateRequest, opts ...grpc.CallOption) (*IssueNodeCertificateResponse, error)
  558. NodeCertificateStatus(ctx context.Context, in *NodeCertificateStatusRequest, opts ...grpc.CallOption) (*NodeCertificateStatusResponse, error)
  559. }
  560. type nodeCAClient struct {
  561. cc *grpc.ClientConn
  562. }
  563. func NewNodeCAClient(cc *grpc.ClientConn) NodeCAClient {
  564. return &nodeCAClient{cc}
  565. }
  566. func (c *nodeCAClient) IssueNodeCertificate(ctx context.Context, in *IssueNodeCertificateRequest, opts ...grpc.CallOption) (*IssueNodeCertificateResponse, error) {
  567. out := new(IssueNodeCertificateResponse)
  568. err := grpc.Invoke(ctx, "/docker.swarmkit.v1.NodeCA/IssueNodeCertificate", in, out, c.cc, opts...)
  569. if err != nil {
  570. return nil, err
  571. }
  572. return out, nil
  573. }
  574. func (c *nodeCAClient) NodeCertificateStatus(ctx context.Context, in *NodeCertificateStatusRequest, opts ...grpc.CallOption) (*NodeCertificateStatusResponse, error) {
  575. out := new(NodeCertificateStatusResponse)
  576. err := grpc.Invoke(ctx, "/docker.swarmkit.v1.NodeCA/NodeCertificateStatus", in, out, c.cc, opts...)
  577. if err != nil {
  578. return nil, err
  579. }
  580. return out, nil
  581. }
  582. // Server API for NodeCA service
  583. type NodeCAServer interface {
  584. IssueNodeCertificate(context.Context, *IssueNodeCertificateRequest) (*IssueNodeCertificateResponse, error)
  585. NodeCertificateStatus(context.Context, *NodeCertificateStatusRequest) (*NodeCertificateStatusResponse, error)
  586. }
  587. func RegisterNodeCAServer(s *grpc.Server, srv NodeCAServer) {
  588. s.RegisterService(&_NodeCA_serviceDesc, srv)
  589. }
  590. func _NodeCA_IssueNodeCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  591. in := new(IssueNodeCertificateRequest)
  592. if err := dec(in); err != nil {
  593. return nil, err
  594. }
  595. if interceptor == nil {
  596. return srv.(NodeCAServer).IssueNodeCertificate(ctx, in)
  597. }
  598. info := &grpc.UnaryServerInfo{
  599. Server: srv,
  600. FullMethod: "/docker.swarmkit.v1.NodeCA/IssueNodeCertificate",
  601. }
  602. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  603. return srv.(NodeCAServer).IssueNodeCertificate(ctx, req.(*IssueNodeCertificateRequest))
  604. }
  605. return interceptor(ctx, in, info, handler)
  606. }
  607. func _NodeCA_NodeCertificateStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  608. in := new(NodeCertificateStatusRequest)
  609. if err := dec(in); err != nil {
  610. return nil, err
  611. }
  612. if interceptor == nil {
  613. return srv.(NodeCAServer).NodeCertificateStatus(ctx, in)
  614. }
  615. info := &grpc.UnaryServerInfo{
  616. Server: srv,
  617. FullMethod: "/docker.swarmkit.v1.NodeCA/NodeCertificateStatus",
  618. }
  619. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  620. return srv.(NodeCAServer).NodeCertificateStatus(ctx, req.(*NodeCertificateStatusRequest))
  621. }
  622. return interceptor(ctx, in, info, handler)
  623. }
  624. var _NodeCA_serviceDesc = grpc.ServiceDesc{
  625. ServiceName: "docker.swarmkit.v1.NodeCA",
  626. HandlerType: (*NodeCAServer)(nil),
  627. Methods: []grpc.MethodDesc{
  628. {
  629. MethodName: "IssueNodeCertificate",
  630. Handler: _NodeCA_IssueNodeCertificate_Handler,
  631. },
  632. {
  633. MethodName: "NodeCertificateStatus",
  634. Handler: _NodeCA_NodeCertificateStatus_Handler,
  635. },
  636. },
  637. Streams: []grpc.StreamDesc{},
  638. Metadata: "github.com/docker/swarmkit/api/ca.proto",
  639. }
  640. func (m *NodeCertificateStatusRequest) Marshal() (dAtA []byte, err error) {
  641. size := m.Size()
  642. dAtA = make([]byte, size)
  643. n, err := m.MarshalTo(dAtA)
  644. if err != nil {
  645. return nil, err
  646. }
  647. return dAtA[:n], nil
  648. }
  649. func (m *NodeCertificateStatusRequest) MarshalTo(dAtA []byte) (int, error) {
  650. var i int
  651. _ = i
  652. var l int
  653. _ = l
  654. if len(m.NodeID) > 0 {
  655. dAtA[i] = 0xa
  656. i++
  657. i = encodeVarintCa(dAtA, i, uint64(len(m.NodeID)))
  658. i += copy(dAtA[i:], m.NodeID)
  659. }
  660. return i, nil
  661. }
  662. func (m *NodeCertificateStatusResponse) Marshal() (dAtA []byte, err error) {
  663. size := m.Size()
  664. dAtA = make([]byte, size)
  665. n, err := m.MarshalTo(dAtA)
  666. if err != nil {
  667. return nil, err
  668. }
  669. return dAtA[:n], nil
  670. }
  671. func (m *NodeCertificateStatusResponse) MarshalTo(dAtA []byte) (int, error) {
  672. var i int
  673. _ = i
  674. var l int
  675. _ = l
  676. if m.Status != nil {
  677. dAtA[i] = 0xa
  678. i++
  679. i = encodeVarintCa(dAtA, i, uint64(m.Status.Size()))
  680. n1, err := m.Status.MarshalTo(dAtA[i:])
  681. if err != nil {
  682. return 0, err
  683. }
  684. i += n1
  685. }
  686. if m.Certificate != nil {
  687. dAtA[i] = 0x12
  688. i++
  689. i = encodeVarintCa(dAtA, i, uint64(m.Certificate.Size()))
  690. n2, err := m.Certificate.MarshalTo(dAtA[i:])
  691. if err != nil {
  692. return 0, err
  693. }
  694. i += n2
  695. }
  696. return i, nil
  697. }
  698. func (m *IssueNodeCertificateRequest) Marshal() (dAtA []byte, err error) {
  699. size := m.Size()
  700. dAtA = make([]byte, size)
  701. n, err := m.MarshalTo(dAtA)
  702. if err != nil {
  703. return nil, err
  704. }
  705. return dAtA[:n], nil
  706. }
  707. func (m *IssueNodeCertificateRequest) MarshalTo(dAtA []byte) (int, error) {
  708. var i int
  709. _ = i
  710. var l int
  711. _ = l
  712. if m.Role != 0 {
  713. dAtA[i] = 0x8
  714. i++
  715. i = encodeVarintCa(dAtA, i, uint64(m.Role))
  716. }
  717. if len(m.CSR) > 0 {
  718. dAtA[i] = 0x12
  719. i++
  720. i = encodeVarintCa(dAtA, i, uint64(len(m.CSR)))
  721. i += copy(dAtA[i:], m.CSR)
  722. }
  723. if len(m.Token) > 0 {
  724. dAtA[i] = 0x1a
  725. i++
  726. i = encodeVarintCa(dAtA, i, uint64(len(m.Token)))
  727. i += copy(dAtA[i:], m.Token)
  728. }
  729. if m.Availability != 0 {
  730. dAtA[i] = 0x20
  731. i++
  732. i = encodeVarintCa(dAtA, i, uint64(m.Availability))
  733. }
  734. return i, nil
  735. }
  736. func (m *IssueNodeCertificateResponse) Marshal() (dAtA []byte, err error) {
  737. size := m.Size()
  738. dAtA = make([]byte, size)
  739. n, err := m.MarshalTo(dAtA)
  740. if err != nil {
  741. return nil, err
  742. }
  743. return dAtA[:n], nil
  744. }
  745. func (m *IssueNodeCertificateResponse) MarshalTo(dAtA []byte) (int, error) {
  746. var i int
  747. _ = i
  748. var l int
  749. _ = l
  750. if len(m.NodeID) > 0 {
  751. dAtA[i] = 0xa
  752. i++
  753. i = encodeVarintCa(dAtA, i, uint64(len(m.NodeID)))
  754. i += copy(dAtA[i:], m.NodeID)
  755. }
  756. if m.NodeMembership != 0 {
  757. dAtA[i] = 0x10
  758. i++
  759. i = encodeVarintCa(dAtA, i, uint64(m.NodeMembership))
  760. }
  761. return i, nil
  762. }
  763. func (m *GetRootCACertificateRequest) Marshal() (dAtA []byte, err error) {
  764. size := m.Size()
  765. dAtA = make([]byte, size)
  766. n, err := m.MarshalTo(dAtA)
  767. if err != nil {
  768. return nil, err
  769. }
  770. return dAtA[:n], nil
  771. }
  772. func (m *GetRootCACertificateRequest) MarshalTo(dAtA []byte) (int, error) {
  773. var i int
  774. _ = i
  775. var l int
  776. _ = l
  777. return i, nil
  778. }
  779. func (m *GetRootCACertificateResponse) Marshal() (dAtA []byte, err error) {
  780. size := m.Size()
  781. dAtA = make([]byte, size)
  782. n, err := m.MarshalTo(dAtA)
  783. if err != nil {
  784. return nil, err
  785. }
  786. return dAtA[:n], nil
  787. }
  788. func (m *GetRootCACertificateResponse) MarshalTo(dAtA []byte) (int, error) {
  789. var i int
  790. _ = i
  791. var l int
  792. _ = l
  793. if len(m.Certificate) > 0 {
  794. dAtA[i] = 0xa
  795. i++
  796. i = encodeVarintCa(dAtA, i, uint64(len(m.Certificate)))
  797. i += copy(dAtA[i:], m.Certificate)
  798. }
  799. return i, nil
  800. }
  801. func (m *GetUnlockKeyRequest) Marshal() (dAtA []byte, err error) {
  802. size := m.Size()
  803. dAtA = make([]byte, size)
  804. n, err := m.MarshalTo(dAtA)
  805. if err != nil {
  806. return nil, err
  807. }
  808. return dAtA[:n], nil
  809. }
  810. func (m *GetUnlockKeyRequest) MarshalTo(dAtA []byte) (int, error) {
  811. var i int
  812. _ = i
  813. var l int
  814. _ = l
  815. return i, nil
  816. }
  817. func (m *GetUnlockKeyResponse) Marshal() (dAtA []byte, err error) {
  818. size := m.Size()
  819. dAtA = make([]byte, size)
  820. n, err := m.MarshalTo(dAtA)
  821. if err != nil {
  822. return nil, err
  823. }
  824. return dAtA[:n], nil
  825. }
  826. func (m *GetUnlockKeyResponse) MarshalTo(dAtA []byte) (int, error) {
  827. var i int
  828. _ = i
  829. var l int
  830. _ = l
  831. if len(m.UnlockKey) > 0 {
  832. dAtA[i] = 0xa
  833. i++
  834. i = encodeVarintCa(dAtA, i, uint64(len(m.UnlockKey)))
  835. i += copy(dAtA[i:], m.UnlockKey)
  836. }
  837. dAtA[i] = 0x12
  838. i++
  839. i = encodeVarintCa(dAtA, i, uint64(m.Version.Size()))
  840. n3, err := m.Version.MarshalTo(dAtA[i:])
  841. if err != nil {
  842. return 0, err
  843. }
  844. i += n3
  845. return i, nil
  846. }
  847. func encodeVarintCa(dAtA []byte, offset int, v uint64) int {
  848. for v >= 1<<7 {
  849. dAtA[offset] = uint8(v&0x7f | 0x80)
  850. v >>= 7
  851. offset++
  852. }
  853. dAtA[offset] = uint8(v)
  854. return offset + 1
  855. }
  856. type raftProxyCAServer struct {
  857. local CAServer
  858. connSelector raftselector.ConnProvider
  859. localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error)
  860. }
  861. func NewRaftProxyCAServer(local CAServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) CAServer {
  862. redirectChecker := func(ctx context.Context) (context.Context, error) {
  863. p, ok := peer.FromContext(ctx)
  864. if !ok {
  865. return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
  866. }
  867. addr := p.Addr.String()
  868. md, ok := metadata.FromIncomingContext(ctx)
  869. if ok && len(md["redirect"]) != 0 {
  870. return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"])
  871. }
  872. if !ok {
  873. md = metadata.New(map[string]string{})
  874. }
  875. md["redirect"] = append(md["redirect"], addr)
  876. return metadata.NewOutgoingContext(ctx, md), nil
  877. }
  878. remoteMods := []func(context.Context) (context.Context, error){redirectChecker}
  879. remoteMods = append(remoteMods, remoteCtxMod)
  880. var localMods []func(context.Context) (context.Context, error)
  881. if localCtxMod != nil {
  882. localMods = []func(context.Context) (context.Context, error){localCtxMod}
  883. }
  884. return &raftProxyCAServer{
  885. local: local,
  886. connSelector: connSelector,
  887. localCtxMods: localMods,
  888. remoteCtxMods: remoteMods,
  889. }
  890. }
  891. func (p *raftProxyCAServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
  892. var err error
  893. for _, mod := range ctxMods {
  894. ctx, err = mod(ctx)
  895. if err != nil {
  896. return ctx, err
  897. }
  898. }
  899. return ctx, nil
  900. }
  901. func (p *raftProxyCAServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) {
  902. ticker := rafttime.NewTicker(500 * rafttime.Millisecond)
  903. defer ticker.Stop()
  904. for {
  905. select {
  906. case <-ticker.C:
  907. conn, err := p.connSelector.LeaderConn(ctx)
  908. if err != nil {
  909. return nil, err
  910. }
  911. client := NewHealthClient(conn)
  912. resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"})
  913. if err != nil || resp.Status != HealthCheckResponse_SERVING {
  914. continue
  915. }
  916. return conn, nil
  917. case <-ctx.Done():
  918. return nil, ctx.Err()
  919. }
  920. }
  921. }
  922. func (p *raftProxyCAServer) GetRootCACertificate(ctx context.Context, r *GetRootCACertificateRequest) (*GetRootCACertificateResponse, error) {
  923. conn, err := p.connSelector.LeaderConn(ctx)
  924. if err != nil {
  925. if err == raftselector.ErrIsLeader {
  926. ctx, err = p.runCtxMods(ctx, p.localCtxMods)
  927. if err != nil {
  928. return nil, err
  929. }
  930. return p.local.GetRootCACertificate(ctx, r)
  931. }
  932. return nil, err
  933. }
  934. modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods)
  935. if err != nil {
  936. return nil, err
  937. }
  938. resp, err := NewCAClient(conn).GetRootCACertificate(modCtx, r)
  939. if err != nil {
  940. if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") {
  941. return resp, err
  942. }
  943. conn, err := p.pollNewLeaderConn(ctx)
  944. if err != nil {
  945. if err == raftselector.ErrIsLeader {
  946. return p.local.GetRootCACertificate(ctx, r)
  947. }
  948. return nil, err
  949. }
  950. return NewCAClient(conn).GetRootCACertificate(modCtx, r)
  951. }
  952. return resp, err
  953. }
  954. func (p *raftProxyCAServer) GetUnlockKey(ctx context.Context, r *GetUnlockKeyRequest) (*GetUnlockKeyResponse, error) {
  955. conn, err := p.connSelector.LeaderConn(ctx)
  956. if err != nil {
  957. if err == raftselector.ErrIsLeader {
  958. ctx, err = p.runCtxMods(ctx, p.localCtxMods)
  959. if err != nil {
  960. return nil, err
  961. }
  962. return p.local.GetUnlockKey(ctx, r)
  963. }
  964. return nil, err
  965. }
  966. modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods)
  967. if err != nil {
  968. return nil, err
  969. }
  970. resp, err := NewCAClient(conn).GetUnlockKey(modCtx, r)
  971. if err != nil {
  972. if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") {
  973. return resp, err
  974. }
  975. conn, err := p.pollNewLeaderConn(ctx)
  976. if err != nil {
  977. if err == raftselector.ErrIsLeader {
  978. return p.local.GetUnlockKey(ctx, r)
  979. }
  980. return nil, err
  981. }
  982. return NewCAClient(conn).GetUnlockKey(modCtx, r)
  983. }
  984. return resp, err
  985. }
  986. type raftProxyNodeCAServer struct {
  987. local NodeCAServer
  988. connSelector raftselector.ConnProvider
  989. localCtxMods, remoteCtxMods []func(context.Context) (context.Context, error)
  990. }
  991. func NewRaftProxyNodeCAServer(local NodeCAServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) NodeCAServer {
  992. redirectChecker := func(ctx context.Context) (context.Context, error) {
  993. p, ok := peer.FromContext(ctx)
  994. if !ok {
  995. return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
  996. }
  997. addr := p.Addr.String()
  998. md, ok := metadata.FromIncomingContext(ctx)
  999. if ok && len(md["redirect"]) != 0 {
  1000. return ctx, status.Errorf(codes.ResourceExhausted, "more than one redirect to leader from: %s", md["redirect"])
  1001. }
  1002. if !ok {
  1003. md = metadata.New(map[string]string{})
  1004. }
  1005. md["redirect"] = append(md["redirect"], addr)
  1006. return metadata.NewOutgoingContext(ctx, md), nil
  1007. }
  1008. remoteMods := []func(context.Context) (context.Context, error){redirectChecker}
  1009. remoteMods = append(remoteMods, remoteCtxMod)
  1010. var localMods []func(context.Context) (context.Context, error)
  1011. if localCtxMod != nil {
  1012. localMods = []func(context.Context) (context.Context, error){localCtxMod}
  1013. }
  1014. return &raftProxyNodeCAServer{
  1015. local: local,
  1016. connSelector: connSelector,
  1017. localCtxMods: localMods,
  1018. remoteCtxMods: remoteMods,
  1019. }
  1020. }
  1021. func (p *raftProxyNodeCAServer) runCtxMods(ctx context.Context, ctxMods []func(context.Context) (context.Context, error)) (context.Context, error) {
  1022. var err error
  1023. for _, mod := range ctxMods {
  1024. ctx, err = mod(ctx)
  1025. if err != nil {
  1026. return ctx, err
  1027. }
  1028. }
  1029. return ctx, nil
  1030. }
  1031. func (p *raftProxyNodeCAServer) pollNewLeaderConn(ctx context.Context) (*grpc.ClientConn, error) {
  1032. ticker := rafttime.NewTicker(500 * rafttime.Millisecond)
  1033. defer ticker.Stop()
  1034. for {
  1035. select {
  1036. case <-ticker.C:
  1037. conn, err := p.connSelector.LeaderConn(ctx)
  1038. if err != nil {
  1039. return nil, err
  1040. }
  1041. client := NewHealthClient(conn)
  1042. resp, err := client.Check(ctx, &HealthCheckRequest{Service: "Raft"})
  1043. if err != nil || resp.Status != HealthCheckResponse_SERVING {
  1044. continue
  1045. }
  1046. return conn, nil
  1047. case <-ctx.Done():
  1048. return nil, ctx.Err()
  1049. }
  1050. }
  1051. }
  1052. func (p *raftProxyNodeCAServer) IssueNodeCertificate(ctx context.Context, r *IssueNodeCertificateRequest) (*IssueNodeCertificateResponse, error) {
  1053. conn, err := p.connSelector.LeaderConn(ctx)
  1054. if err != nil {
  1055. if err == raftselector.ErrIsLeader {
  1056. ctx, err = p.runCtxMods(ctx, p.localCtxMods)
  1057. if err != nil {
  1058. return nil, err
  1059. }
  1060. return p.local.IssueNodeCertificate(ctx, r)
  1061. }
  1062. return nil, err
  1063. }
  1064. modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods)
  1065. if err != nil {
  1066. return nil, err
  1067. }
  1068. resp, err := NewNodeCAClient(conn).IssueNodeCertificate(modCtx, r)
  1069. if err != nil {
  1070. if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") {
  1071. return resp, err
  1072. }
  1073. conn, err := p.pollNewLeaderConn(ctx)
  1074. if err != nil {
  1075. if err == raftselector.ErrIsLeader {
  1076. return p.local.IssueNodeCertificate(ctx, r)
  1077. }
  1078. return nil, err
  1079. }
  1080. return NewNodeCAClient(conn).IssueNodeCertificate(modCtx, r)
  1081. }
  1082. return resp, err
  1083. }
  1084. func (p *raftProxyNodeCAServer) NodeCertificateStatus(ctx context.Context, r *NodeCertificateStatusRequest) (*NodeCertificateStatusResponse, error) {
  1085. conn, err := p.connSelector.LeaderConn(ctx)
  1086. if err != nil {
  1087. if err == raftselector.ErrIsLeader {
  1088. ctx, err = p.runCtxMods(ctx, p.localCtxMods)
  1089. if err != nil {
  1090. return nil, err
  1091. }
  1092. return p.local.NodeCertificateStatus(ctx, r)
  1093. }
  1094. return nil, err
  1095. }
  1096. modCtx, err := p.runCtxMods(ctx, p.remoteCtxMods)
  1097. if err != nil {
  1098. return nil, err
  1099. }
  1100. resp, err := NewNodeCAClient(conn).NodeCertificateStatus(modCtx, r)
  1101. if err != nil {
  1102. if !strings.Contains(err.Error(), "is closing") && !strings.Contains(err.Error(), "the connection is unavailable") && !strings.Contains(err.Error(), "connection error") {
  1103. return resp, err
  1104. }
  1105. conn, err := p.pollNewLeaderConn(ctx)
  1106. if err != nil {
  1107. if err == raftselector.ErrIsLeader {
  1108. return p.local.NodeCertificateStatus(ctx, r)
  1109. }
  1110. return nil, err
  1111. }
  1112. return NewNodeCAClient(conn).NodeCertificateStatus(modCtx, r)
  1113. }
  1114. return resp, err
  1115. }
  1116. func (m *NodeCertificateStatusRequest) Size() (n int) {
  1117. var l int
  1118. _ = l
  1119. l = len(m.NodeID)
  1120. if l > 0 {
  1121. n += 1 + l + sovCa(uint64(l))
  1122. }
  1123. return n
  1124. }
  1125. func (m *NodeCertificateStatusResponse) Size() (n int) {
  1126. var l int
  1127. _ = l
  1128. if m.Status != nil {
  1129. l = m.Status.Size()
  1130. n += 1 + l + sovCa(uint64(l))
  1131. }
  1132. if m.Certificate != nil {
  1133. l = m.Certificate.Size()
  1134. n += 1 + l + sovCa(uint64(l))
  1135. }
  1136. return n
  1137. }
  1138. func (m *IssueNodeCertificateRequest) Size() (n int) {
  1139. var l int
  1140. _ = l
  1141. if m.Role != 0 {
  1142. n += 1 + sovCa(uint64(m.Role))
  1143. }
  1144. l = len(m.CSR)
  1145. if l > 0 {
  1146. n += 1 + l + sovCa(uint64(l))
  1147. }
  1148. l = len(m.Token)
  1149. if l > 0 {
  1150. n += 1 + l + sovCa(uint64(l))
  1151. }
  1152. if m.Availability != 0 {
  1153. n += 1 + sovCa(uint64(m.Availability))
  1154. }
  1155. return n
  1156. }
  1157. func (m *IssueNodeCertificateResponse) Size() (n int) {
  1158. var l int
  1159. _ = l
  1160. l = len(m.NodeID)
  1161. if l > 0 {
  1162. n += 1 + l + sovCa(uint64(l))
  1163. }
  1164. if m.NodeMembership != 0 {
  1165. n += 1 + sovCa(uint64(m.NodeMembership))
  1166. }
  1167. return n
  1168. }
  1169. func (m *GetRootCACertificateRequest) Size() (n int) {
  1170. var l int
  1171. _ = l
  1172. return n
  1173. }
  1174. func (m *GetRootCACertificateResponse) Size() (n int) {
  1175. var l int
  1176. _ = l
  1177. l = len(m.Certificate)
  1178. if l > 0 {
  1179. n += 1 + l + sovCa(uint64(l))
  1180. }
  1181. return n
  1182. }
  1183. func (m *GetUnlockKeyRequest) Size() (n int) {
  1184. var l int
  1185. _ = l
  1186. return n
  1187. }
  1188. func (m *GetUnlockKeyResponse) Size() (n int) {
  1189. var l int
  1190. _ = l
  1191. l = len(m.UnlockKey)
  1192. if l > 0 {
  1193. n += 1 + l + sovCa(uint64(l))
  1194. }
  1195. l = m.Version.Size()
  1196. n += 1 + l + sovCa(uint64(l))
  1197. return n
  1198. }
  1199. func sovCa(x uint64) (n int) {
  1200. for {
  1201. n++
  1202. x >>= 7
  1203. if x == 0 {
  1204. break
  1205. }
  1206. }
  1207. return n
  1208. }
  1209. func sozCa(x uint64) (n int) {
  1210. return sovCa(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  1211. }
  1212. func (this *NodeCertificateStatusRequest) String() string {
  1213. if this == nil {
  1214. return "nil"
  1215. }
  1216. s := strings.Join([]string{`&NodeCertificateStatusRequest{`,
  1217. `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`,
  1218. `}`,
  1219. }, "")
  1220. return s
  1221. }
  1222. func (this *NodeCertificateStatusResponse) String() string {
  1223. if this == nil {
  1224. return "nil"
  1225. }
  1226. s := strings.Join([]string{`&NodeCertificateStatusResponse{`,
  1227. `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "IssuanceStatus", "IssuanceStatus", 1) + `,`,
  1228. `Certificate:` + strings.Replace(fmt.Sprintf("%v", this.Certificate), "Certificate", "Certificate", 1) + `,`,
  1229. `}`,
  1230. }, "")
  1231. return s
  1232. }
  1233. func (this *IssueNodeCertificateRequest) String() string {
  1234. if this == nil {
  1235. return "nil"
  1236. }
  1237. s := strings.Join([]string{`&IssueNodeCertificateRequest{`,
  1238. `Role:` + fmt.Sprintf("%v", this.Role) + `,`,
  1239. `CSR:` + fmt.Sprintf("%v", this.CSR) + `,`,
  1240. `Token:` + fmt.Sprintf("%v", this.Token) + `,`,
  1241. `Availability:` + fmt.Sprintf("%v", this.Availability) + `,`,
  1242. `}`,
  1243. }, "")
  1244. return s
  1245. }
  1246. func (this *IssueNodeCertificateResponse) String() string {
  1247. if this == nil {
  1248. return "nil"
  1249. }
  1250. s := strings.Join([]string{`&IssueNodeCertificateResponse{`,
  1251. `NodeID:` + fmt.Sprintf("%v", this.NodeID) + `,`,
  1252. `NodeMembership:` + fmt.Sprintf("%v", this.NodeMembership) + `,`,
  1253. `}`,
  1254. }, "")
  1255. return s
  1256. }
  1257. func (this *GetRootCACertificateRequest) String() string {
  1258. if this == nil {
  1259. return "nil"
  1260. }
  1261. s := strings.Join([]string{`&GetRootCACertificateRequest{`,
  1262. `}`,
  1263. }, "")
  1264. return s
  1265. }
  1266. func (this *GetRootCACertificateResponse) String() string {
  1267. if this == nil {
  1268. return "nil"
  1269. }
  1270. s := strings.Join([]string{`&GetRootCACertificateResponse{`,
  1271. `Certificate:` + fmt.Sprintf("%v", this.Certificate) + `,`,
  1272. `}`,
  1273. }, "")
  1274. return s
  1275. }
  1276. func (this *GetUnlockKeyRequest) String() string {
  1277. if this == nil {
  1278. return "nil"
  1279. }
  1280. s := strings.Join([]string{`&GetUnlockKeyRequest{`,
  1281. `}`,
  1282. }, "")
  1283. return s
  1284. }
  1285. func (this *GetUnlockKeyResponse) String() string {
  1286. if this == nil {
  1287. return "nil"
  1288. }
  1289. s := strings.Join([]string{`&GetUnlockKeyResponse{`,
  1290. `UnlockKey:` + fmt.Sprintf("%v", this.UnlockKey) + `,`,
  1291. `Version:` + strings.Replace(strings.Replace(this.Version.String(), "Version", "Version", 1), `&`, ``, 1) + `,`,
  1292. `}`,
  1293. }, "")
  1294. return s
  1295. }
  1296. func valueToStringCa(v interface{}) string {
  1297. rv := reflect.ValueOf(v)
  1298. if rv.IsNil() {
  1299. return "nil"
  1300. }
  1301. pv := reflect.Indirect(rv).Interface()
  1302. return fmt.Sprintf("*%v", pv)
  1303. }
  1304. func (m *NodeCertificateStatusRequest) Unmarshal(dAtA []byte) error {
  1305. l := len(dAtA)
  1306. iNdEx := 0
  1307. for iNdEx < l {
  1308. preIndex := iNdEx
  1309. var wire uint64
  1310. for shift := uint(0); ; shift += 7 {
  1311. if shift >= 64 {
  1312. return ErrIntOverflowCa
  1313. }
  1314. if iNdEx >= l {
  1315. return io.ErrUnexpectedEOF
  1316. }
  1317. b := dAtA[iNdEx]
  1318. iNdEx++
  1319. wire |= (uint64(b) & 0x7F) << shift
  1320. if b < 0x80 {
  1321. break
  1322. }
  1323. }
  1324. fieldNum := int32(wire >> 3)
  1325. wireType := int(wire & 0x7)
  1326. if wireType == 4 {
  1327. return fmt.Errorf("proto: NodeCertificateStatusRequest: wiretype end group for non-group")
  1328. }
  1329. if fieldNum <= 0 {
  1330. return fmt.Errorf("proto: NodeCertificateStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  1331. }
  1332. switch fieldNum {
  1333. case 1:
  1334. if wireType != 2 {
  1335. return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
  1336. }
  1337. var stringLen uint64
  1338. for shift := uint(0); ; shift += 7 {
  1339. if shift >= 64 {
  1340. return ErrIntOverflowCa
  1341. }
  1342. if iNdEx >= l {
  1343. return io.ErrUnexpectedEOF
  1344. }
  1345. b := dAtA[iNdEx]
  1346. iNdEx++
  1347. stringLen |= (uint64(b) & 0x7F) << shift
  1348. if b < 0x80 {
  1349. break
  1350. }
  1351. }
  1352. intStringLen := int(stringLen)
  1353. if intStringLen < 0 {
  1354. return ErrInvalidLengthCa
  1355. }
  1356. postIndex := iNdEx + intStringLen
  1357. if postIndex > l {
  1358. return io.ErrUnexpectedEOF
  1359. }
  1360. m.NodeID = string(dAtA[iNdEx:postIndex])
  1361. iNdEx = postIndex
  1362. default:
  1363. iNdEx = preIndex
  1364. skippy, err := skipCa(dAtA[iNdEx:])
  1365. if err != nil {
  1366. return err
  1367. }
  1368. if skippy < 0 {
  1369. return ErrInvalidLengthCa
  1370. }
  1371. if (iNdEx + skippy) > l {
  1372. return io.ErrUnexpectedEOF
  1373. }
  1374. iNdEx += skippy
  1375. }
  1376. }
  1377. if iNdEx > l {
  1378. return io.ErrUnexpectedEOF
  1379. }
  1380. return nil
  1381. }
  1382. func (m *NodeCertificateStatusResponse) Unmarshal(dAtA []byte) error {
  1383. l := len(dAtA)
  1384. iNdEx := 0
  1385. for iNdEx < l {
  1386. preIndex := iNdEx
  1387. var wire uint64
  1388. for shift := uint(0); ; shift += 7 {
  1389. if shift >= 64 {
  1390. return ErrIntOverflowCa
  1391. }
  1392. if iNdEx >= l {
  1393. return io.ErrUnexpectedEOF
  1394. }
  1395. b := dAtA[iNdEx]
  1396. iNdEx++
  1397. wire |= (uint64(b) & 0x7F) << shift
  1398. if b < 0x80 {
  1399. break
  1400. }
  1401. }
  1402. fieldNum := int32(wire >> 3)
  1403. wireType := int(wire & 0x7)
  1404. if wireType == 4 {
  1405. return fmt.Errorf("proto: NodeCertificateStatusResponse: wiretype end group for non-group")
  1406. }
  1407. if fieldNum <= 0 {
  1408. return fmt.Errorf("proto: NodeCertificateStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  1409. }
  1410. switch fieldNum {
  1411. case 1:
  1412. if wireType != 2 {
  1413. return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
  1414. }
  1415. var msglen int
  1416. for shift := uint(0); ; shift += 7 {
  1417. if shift >= 64 {
  1418. return ErrIntOverflowCa
  1419. }
  1420. if iNdEx >= l {
  1421. return io.ErrUnexpectedEOF
  1422. }
  1423. b := dAtA[iNdEx]
  1424. iNdEx++
  1425. msglen |= (int(b) & 0x7F) << shift
  1426. if b < 0x80 {
  1427. break
  1428. }
  1429. }
  1430. if msglen < 0 {
  1431. return ErrInvalidLengthCa
  1432. }
  1433. postIndex := iNdEx + msglen
  1434. if postIndex > l {
  1435. return io.ErrUnexpectedEOF
  1436. }
  1437. if m.Status == nil {
  1438. m.Status = &IssuanceStatus{}
  1439. }
  1440. if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1441. return err
  1442. }
  1443. iNdEx = postIndex
  1444. case 2:
  1445. if wireType != 2 {
  1446. return fmt.Errorf("proto: wrong wireType = %d for field Certificate", wireType)
  1447. }
  1448. var msglen int
  1449. for shift := uint(0); ; shift += 7 {
  1450. if shift >= 64 {
  1451. return ErrIntOverflowCa
  1452. }
  1453. if iNdEx >= l {
  1454. return io.ErrUnexpectedEOF
  1455. }
  1456. b := dAtA[iNdEx]
  1457. iNdEx++
  1458. msglen |= (int(b) & 0x7F) << shift
  1459. if b < 0x80 {
  1460. break
  1461. }
  1462. }
  1463. if msglen < 0 {
  1464. return ErrInvalidLengthCa
  1465. }
  1466. postIndex := iNdEx + msglen
  1467. if postIndex > l {
  1468. return io.ErrUnexpectedEOF
  1469. }
  1470. if m.Certificate == nil {
  1471. m.Certificate = &Certificate{}
  1472. }
  1473. if err := m.Certificate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1474. return err
  1475. }
  1476. iNdEx = postIndex
  1477. default:
  1478. iNdEx = preIndex
  1479. skippy, err := skipCa(dAtA[iNdEx:])
  1480. if err != nil {
  1481. return err
  1482. }
  1483. if skippy < 0 {
  1484. return ErrInvalidLengthCa
  1485. }
  1486. if (iNdEx + skippy) > l {
  1487. return io.ErrUnexpectedEOF
  1488. }
  1489. iNdEx += skippy
  1490. }
  1491. }
  1492. if iNdEx > l {
  1493. return io.ErrUnexpectedEOF
  1494. }
  1495. return nil
  1496. }
  1497. func (m *IssueNodeCertificateRequest) Unmarshal(dAtA []byte) error {
  1498. l := len(dAtA)
  1499. iNdEx := 0
  1500. for iNdEx < l {
  1501. preIndex := iNdEx
  1502. var wire uint64
  1503. for shift := uint(0); ; shift += 7 {
  1504. if shift >= 64 {
  1505. return ErrIntOverflowCa
  1506. }
  1507. if iNdEx >= l {
  1508. return io.ErrUnexpectedEOF
  1509. }
  1510. b := dAtA[iNdEx]
  1511. iNdEx++
  1512. wire |= (uint64(b) & 0x7F) << shift
  1513. if b < 0x80 {
  1514. break
  1515. }
  1516. }
  1517. fieldNum := int32(wire >> 3)
  1518. wireType := int(wire & 0x7)
  1519. if wireType == 4 {
  1520. return fmt.Errorf("proto: IssueNodeCertificateRequest: wiretype end group for non-group")
  1521. }
  1522. if fieldNum <= 0 {
  1523. return fmt.Errorf("proto: IssueNodeCertificateRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  1524. }
  1525. switch fieldNum {
  1526. case 1:
  1527. if wireType != 0 {
  1528. return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType)
  1529. }
  1530. m.Role = 0
  1531. for shift := uint(0); ; shift += 7 {
  1532. if shift >= 64 {
  1533. return ErrIntOverflowCa
  1534. }
  1535. if iNdEx >= l {
  1536. return io.ErrUnexpectedEOF
  1537. }
  1538. b := dAtA[iNdEx]
  1539. iNdEx++
  1540. m.Role |= (NodeRole(b) & 0x7F) << shift
  1541. if b < 0x80 {
  1542. break
  1543. }
  1544. }
  1545. case 2:
  1546. if wireType != 2 {
  1547. return fmt.Errorf("proto: wrong wireType = %d for field CSR", wireType)
  1548. }
  1549. var byteLen int
  1550. for shift := uint(0); ; shift += 7 {
  1551. if shift >= 64 {
  1552. return ErrIntOverflowCa
  1553. }
  1554. if iNdEx >= l {
  1555. return io.ErrUnexpectedEOF
  1556. }
  1557. b := dAtA[iNdEx]
  1558. iNdEx++
  1559. byteLen |= (int(b) & 0x7F) << shift
  1560. if b < 0x80 {
  1561. break
  1562. }
  1563. }
  1564. if byteLen < 0 {
  1565. return ErrInvalidLengthCa
  1566. }
  1567. postIndex := iNdEx + byteLen
  1568. if postIndex > l {
  1569. return io.ErrUnexpectedEOF
  1570. }
  1571. m.CSR = append(m.CSR[:0], dAtA[iNdEx:postIndex]...)
  1572. if m.CSR == nil {
  1573. m.CSR = []byte{}
  1574. }
  1575. iNdEx = postIndex
  1576. case 3:
  1577. if wireType != 2 {
  1578. return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType)
  1579. }
  1580. var stringLen uint64
  1581. for shift := uint(0); ; shift += 7 {
  1582. if shift >= 64 {
  1583. return ErrIntOverflowCa
  1584. }
  1585. if iNdEx >= l {
  1586. return io.ErrUnexpectedEOF
  1587. }
  1588. b := dAtA[iNdEx]
  1589. iNdEx++
  1590. stringLen |= (uint64(b) & 0x7F) << shift
  1591. if b < 0x80 {
  1592. break
  1593. }
  1594. }
  1595. intStringLen := int(stringLen)
  1596. if intStringLen < 0 {
  1597. return ErrInvalidLengthCa
  1598. }
  1599. postIndex := iNdEx + intStringLen
  1600. if postIndex > l {
  1601. return io.ErrUnexpectedEOF
  1602. }
  1603. m.Token = string(dAtA[iNdEx:postIndex])
  1604. iNdEx = postIndex
  1605. case 4:
  1606. if wireType != 0 {
  1607. return fmt.Errorf("proto: wrong wireType = %d for field Availability", wireType)
  1608. }
  1609. m.Availability = 0
  1610. for shift := uint(0); ; shift += 7 {
  1611. if shift >= 64 {
  1612. return ErrIntOverflowCa
  1613. }
  1614. if iNdEx >= l {
  1615. return io.ErrUnexpectedEOF
  1616. }
  1617. b := dAtA[iNdEx]
  1618. iNdEx++
  1619. m.Availability |= (NodeSpec_Availability(b) & 0x7F) << shift
  1620. if b < 0x80 {
  1621. break
  1622. }
  1623. }
  1624. default:
  1625. iNdEx = preIndex
  1626. skippy, err := skipCa(dAtA[iNdEx:])
  1627. if err != nil {
  1628. return err
  1629. }
  1630. if skippy < 0 {
  1631. return ErrInvalidLengthCa
  1632. }
  1633. if (iNdEx + skippy) > l {
  1634. return io.ErrUnexpectedEOF
  1635. }
  1636. iNdEx += skippy
  1637. }
  1638. }
  1639. if iNdEx > l {
  1640. return io.ErrUnexpectedEOF
  1641. }
  1642. return nil
  1643. }
  1644. func (m *IssueNodeCertificateResponse) Unmarshal(dAtA []byte) error {
  1645. l := len(dAtA)
  1646. iNdEx := 0
  1647. for iNdEx < l {
  1648. preIndex := iNdEx
  1649. var wire uint64
  1650. for shift := uint(0); ; shift += 7 {
  1651. if shift >= 64 {
  1652. return ErrIntOverflowCa
  1653. }
  1654. if iNdEx >= l {
  1655. return io.ErrUnexpectedEOF
  1656. }
  1657. b := dAtA[iNdEx]
  1658. iNdEx++
  1659. wire |= (uint64(b) & 0x7F) << shift
  1660. if b < 0x80 {
  1661. break
  1662. }
  1663. }
  1664. fieldNum := int32(wire >> 3)
  1665. wireType := int(wire & 0x7)
  1666. if wireType == 4 {
  1667. return fmt.Errorf("proto: IssueNodeCertificateResponse: wiretype end group for non-group")
  1668. }
  1669. if fieldNum <= 0 {
  1670. return fmt.Errorf("proto: IssueNodeCertificateResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  1671. }
  1672. switch fieldNum {
  1673. case 1:
  1674. if wireType != 2 {
  1675. return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
  1676. }
  1677. var stringLen uint64
  1678. for shift := uint(0); ; shift += 7 {
  1679. if shift >= 64 {
  1680. return ErrIntOverflowCa
  1681. }
  1682. if iNdEx >= l {
  1683. return io.ErrUnexpectedEOF
  1684. }
  1685. b := dAtA[iNdEx]
  1686. iNdEx++
  1687. stringLen |= (uint64(b) & 0x7F) << shift
  1688. if b < 0x80 {
  1689. break
  1690. }
  1691. }
  1692. intStringLen := int(stringLen)
  1693. if intStringLen < 0 {
  1694. return ErrInvalidLengthCa
  1695. }
  1696. postIndex := iNdEx + intStringLen
  1697. if postIndex > l {
  1698. return io.ErrUnexpectedEOF
  1699. }
  1700. m.NodeID = string(dAtA[iNdEx:postIndex])
  1701. iNdEx = postIndex
  1702. case 2:
  1703. if wireType != 0 {
  1704. return fmt.Errorf("proto: wrong wireType = %d for field NodeMembership", wireType)
  1705. }
  1706. m.NodeMembership = 0
  1707. for shift := uint(0); ; shift += 7 {
  1708. if shift >= 64 {
  1709. return ErrIntOverflowCa
  1710. }
  1711. if iNdEx >= l {
  1712. return io.ErrUnexpectedEOF
  1713. }
  1714. b := dAtA[iNdEx]
  1715. iNdEx++
  1716. m.NodeMembership |= (NodeSpec_Membership(b) & 0x7F) << shift
  1717. if b < 0x80 {
  1718. break
  1719. }
  1720. }
  1721. default:
  1722. iNdEx = preIndex
  1723. skippy, err := skipCa(dAtA[iNdEx:])
  1724. if err != nil {
  1725. return err
  1726. }
  1727. if skippy < 0 {
  1728. return ErrInvalidLengthCa
  1729. }
  1730. if (iNdEx + skippy) > l {
  1731. return io.ErrUnexpectedEOF
  1732. }
  1733. iNdEx += skippy
  1734. }
  1735. }
  1736. if iNdEx > l {
  1737. return io.ErrUnexpectedEOF
  1738. }
  1739. return nil
  1740. }
  1741. func (m *GetRootCACertificateRequest) Unmarshal(dAtA []byte) error {
  1742. l := len(dAtA)
  1743. iNdEx := 0
  1744. for iNdEx < l {
  1745. preIndex := iNdEx
  1746. var wire uint64
  1747. for shift := uint(0); ; shift += 7 {
  1748. if shift >= 64 {
  1749. return ErrIntOverflowCa
  1750. }
  1751. if iNdEx >= l {
  1752. return io.ErrUnexpectedEOF
  1753. }
  1754. b := dAtA[iNdEx]
  1755. iNdEx++
  1756. wire |= (uint64(b) & 0x7F) << shift
  1757. if b < 0x80 {
  1758. break
  1759. }
  1760. }
  1761. fieldNum := int32(wire >> 3)
  1762. wireType := int(wire & 0x7)
  1763. if wireType == 4 {
  1764. return fmt.Errorf("proto: GetRootCACertificateRequest: wiretype end group for non-group")
  1765. }
  1766. if fieldNum <= 0 {
  1767. return fmt.Errorf("proto: GetRootCACertificateRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  1768. }
  1769. switch fieldNum {
  1770. default:
  1771. iNdEx = preIndex
  1772. skippy, err := skipCa(dAtA[iNdEx:])
  1773. if err != nil {
  1774. return err
  1775. }
  1776. if skippy < 0 {
  1777. return ErrInvalidLengthCa
  1778. }
  1779. if (iNdEx + skippy) > l {
  1780. return io.ErrUnexpectedEOF
  1781. }
  1782. iNdEx += skippy
  1783. }
  1784. }
  1785. if iNdEx > l {
  1786. return io.ErrUnexpectedEOF
  1787. }
  1788. return nil
  1789. }
  1790. func (m *GetRootCACertificateResponse) Unmarshal(dAtA []byte) error {
  1791. l := len(dAtA)
  1792. iNdEx := 0
  1793. for iNdEx < l {
  1794. preIndex := iNdEx
  1795. var wire uint64
  1796. for shift := uint(0); ; shift += 7 {
  1797. if shift >= 64 {
  1798. return ErrIntOverflowCa
  1799. }
  1800. if iNdEx >= l {
  1801. return io.ErrUnexpectedEOF
  1802. }
  1803. b := dAtA[iNdEx]
  1804. iNdEx++
  1805. wire |= (uint64(b) & 0x7F) << shift
  1806. if b < 0x80 {
  1807. break
  1808. }
  1809. }
  1810. fieldNum := int32(wire >> 3)
  1811. wireType := int(wire & 0x7)
  1812. if wireType == 4 {
  1813. return fmt.Errorf("proto: GetRootCACertificateResponse: wiretype end group for non-group")
  1814. }
  1815. if fieldNum <= 0 {
  1816. return fmt.Errorf("proto: GetRootCACertificateResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  1817. }
  1818. switch fieldNum {
  1819. case 1:
  1820. if wireType != 2 {
  1821. return fmt.Errorf("proto: wrong wireType = %d for field Certificate", wireType)
  1822. }
  1823. var byteLen int
  1824. for shift := uint(0); ; shift += 7 {
  1825. if shift >= 64 {
  1826. return ErrIntOverflowCa
  1827. }
  1828. if iNdEx >= l {
  1829. return io.ErrUnexpectedEOF
  1830. }
  1831. b := dAtA[iNdEx]
  1832. iNdEx++
  1833. byteLen |= (int(b) & 0x7F) << shift
  1834. if b < 0x80 {
  1835. break
  1836. }
  1837. }
  1838. if byteLen < 0 {
  1839. return ErrInvalidLengthCa
  1840. }
  1841. postIndex := iNdEx + byteLen
  1842. if postIndex > l {
  1843. return io.ErrUnexpectedEOF
  1844. }
  1845. m.Certificate = append(m.Certificate[:0], dAtA[iNdEx:postIndex]...)
  1846. if m.Certificate == nil {
  1847. m.Certificate = []byte{}
  1848. }
  1849. iNdEx = postIndex
  1850. default:
  1851. iNdEx = preIndex
  1852. skippy, err := skipCa(dAtA[iNdEx:])
  1853. if err != nil {
  1854. return err
  1855. }
  1856. if skippy < 0 {
  1857. return ErrInvalidLengthCa
  1858. }
  1859. if (iNdEx + skippy) > l {
  1860. return io.ErrUnexpectedEOF
  1861. }
  1862. iNdEx += skippy
  1863. }
  1864. }
  1865. if iNdEx > l {
  1866. return io.ErrUnexpectedEOF
  1867. }
  1868. return nil
  1869. }
  1870. func (m *GetUnlockKeyRequest) Unmarshal(dAtA []byte) error {
  1871. l := len(dAtA)
  1872. iNdEx := 0
  1873. for iNdEx < l {
  1874. preIndex := iNdEx
  1875. var wire uint64
  1876. for shift := uint(0); ; shift += 7 {
  1877. if shift >= 64 {
  1878. return ErrIntOverflowCa
  1879. }
  1880. if iNdEx >= l {
  1881. return io.ErrUnexpectedEOF
  1882. }
  1883. b := dAtA[iNdEx]
  1884. iNdEx++
  1885. wire |= (uint64(b) & 0x7F) << shift
  1886. if b < 0x80 {
  1887. break
  1888. }
  1889. }
  1890. fieldNum := int32(wire >> 3)
  1891. wireType := int(wire & 0x7)
  1892. if wireType == 4 {
  1893. return fmt.Errorf("proto: GetUnlockKeyRequest: wiretype end group for non-group")
  1894. }
  1895. if fieldNum <= 0 {
  1896. return fmt.Errorf("proto: GetUnlockKeyRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  1897. }
  1898. switch fieldNum {
  1899. default:
  1900. iNdEx = preIndex
  1901. skippy, err := skipCa(dAtA[iNdEx:])
  1902. if err != nil {
  1903. return err
  1904. }
  1905. if skippy < 0 {
  1906. return ErrInvalidLengthCa
  1907. }
  1908. if (iNdEx + skippy) > l {
  1909. return io.ErrUnexpectedEOF
  1910. }
  1911. iNdEx += skippy
  1912. }
  1913. }
  1914. if iNdEx > l {
  1915. return io.ErrUnexpectedEOF
  1916. }
  1917. return nil
  1918. }
  1919. func (m *GetUnlockKeyResponse) Unmarshal(dAtA []byte) error {
  1920. l := len(dAtA)
  1921. iNdEx := 0
  1922. for iNdEx < l {
  1923. preIndex := iNdEx
  1924. var wire uint64
  1925. for shift := uint(0); ; shift += 7 {
  1926. if shift >= 64 {
  1927. return ErrIntOverflowCa
  1928. }
  1929. if iNdEx >= l {
  1930. return io.ErrUnexpectedEOF
  1931. }
  1932. b := dAtA[iNdEx]
  1933. iNdEx++
  1934. wire |= (uint64(b) & 0x7F) << shift
  1935. if b < 0x80 {
  1936. break
  1937. }
  1938. }
  1939. fieldNum := int32(wire >> 3)
  1940. wireType := int(wire & 0x7)
  1941. if wireType == 4 {
  1942. return fmt.Errorf("proto: GetUnlockKeyResponse: wiretype end group for non-group")
  1943. }
  1944. if fieldNum <= 0 {
  1945. return fmt.Errorf("proto: GetUnlockKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  1946. }
  1947. switch fieldNum {
  1948. case 1:
  1949. if wireType != 2 {
  1950. return fmt.Errorf("proto: wrong wireType = %d for field UnlockKey", wireType)
  1951. }
  1952. var byteLen int
  1953. for shift := uint(0); ; shift += 7 {
  1954. if shift >= 64 {
  1955. return ErrIntOverflowCa
  1956. }
  1957. if iNdEx >= l {
  1958. return io.ErrUnexpectedEOF
  1959. }
  1960. b := dAtA[iNdEx]
  1961. iNdEx++
  1962. byteLen |= (int(b) & 0x7F) << shift
  1963. if b < 0x80 {
  1964. break
  1965. }
  1966. }
  1967. if byteLen < 0 {
  1968. return ErrInvalidLengthCa
  1969. }
  1970. postIndex := iNdEx + byteLen
  1971. if postIndex > l {
  1972. return io.ErrUnexpectedEOF
  1973. }
  1974. m.UnlockKey = append(m.UnlockKey[:0], dAtA[iNdEx:postIndex]...)
  1975. if m.UnlockKey == nil {
  1976. m.UnlockKey = []byte{}
  1977. }
  1978. iNdEx = postIndex
  1979. case 2:
  1980. if wireType != 2 {
  1981. return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
  1982. }
  1983. var msglen int
  1984. for shift := uint(0); ; shift += 7 {
  1985. if shift >= 64 {
  1986. return ErrIntOverflowCa
  1987. }
  1988. if iNdEx >= l {
  1989. return io.ErrUnexpectedEOF
  1990. }
  1991. b := dAtA[iNdEx]
  1992. iNdEx++
  1993. msglen |= (int(b) & 0x7F) << shift
  1994. if b < 0x80 {
  1995. break
  1996. }
  1997. }
  1998. if msglen < 0 {
  1999. return ErrInvalidLengthCa
  2000. }
  2001. postIndex := iNdEx + msglen
  2002. if postIndex > l {
  2003. return io.ErrUnexpectedEOF
  2004. }
  2005. if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2006. return err
  2007. }
  2008. iNdEx = postIndex
  2009. default:
  2010. iNdEx = preIndex
  2011. skippy, err := skipCa(dAtA[iNdEx:])
  2012. if err != nil {
  2013. return err
  2014. }
  2015. if skippy < 0 {
  2016. return ErrInvalidLengthCa
  2017. }
  2018. if (iNdEx + skippy) > l {
  2019. return io.ErrUnexpectedEOF
  2020. }
  2021. iNdEx += skippy
  2022. }
  2023. }
  2024. if iNdEx > l {
  2025. return io.ErrUnexpectedEOF
  2026. }
  2027. return nil
  2028. }
  2029. func skipCa(dAtA []byte) (n int, err error) {
  2030. l := len(dAtA)
  2031. iNdEx := 0
  2032. for iNdEx < l {
  2033. var wire uint64
  2034. for shift := uint(0); ; shift += 7 {
  2035. if shift >= 64 {
  2036. return 0, ErrIntOverflowCa
  2037. }
  2038. if iNdEx >= l {
  2039. return 0, io.ErrUnexpectedEOF
  2040. }
  2041. b := dAtA[iNdEx]
  2042. iNdEx++
  2043. wire |= (uint64(b) & 0x7F) << shift
  2044. if b < 0x80 {
  2045. break
  2046. }
  2047. }
  2048. wireType := int(wire & 0x7)
  2049. switch wireType {
  2050. case 0:
  2051. for shift := uint(0); ; shift += 7 {
  2052. if shift >= 64 {
  2053. return 0, ErrIntOverflowCa
  2054. }
  2055. if iNdEx >= l {
  2056. return 0, io.ErrUnexpectedEOF
  2057. }
  2058. iNdEx++
  2059. if dAtA[iNdEx-1] < 0x80 {
  2060. break
  2061. }
  2062. }
  2063. return iNdEx, nil
  2064. case 1:
  2065. iNdEx += 8
  2066. return iNdEx, nil
  2067. case 2:
  2068. var length int
  2069. for shift := uint(0); ; shift += 7 {
  2070. if shift >= 64 {
  2071. return 0, ErrIntOverflowCa
  2072. }
  2073. if iNdEx >= l {
  2074. return 0, io.ErrUnexpectedEOF
  2075. }
  2076. b := dAtA[iNdEx]
  2077. iNdEx++
  2078. length |= (int(b) & 0x7F) << shift
  2079. if b < 0x80 {
  2080. break
  2081. }
  2082. }
  2083. iNdEx += length
  2084. if length < 0 {
  2085. return 0, ErrInvalidLengthCa
  2086. }
  2087. return iNdEx, nil
  2088. case 3:
  2089. for {
  2090. var innerWire uint64
  2091. var start int = iNdEx
  2092. for shift := uint(0); ; shift += 7 {
  2093. if shift >= 64 {
  2094. return 0, ErrIntOverflowCa
  2095. }
  2096. if iNdEx >= l {
  2097. return 0, io.ErrUnexpectedEOF
  2098. }
  2099. b := dAtA[iNdEx]
  2100. iNdEx++
  2101. innerWire |= (uint64(b) & 0x7F) << shift
  2102. if b < 0x80 {
  2103. break
  2104. }
  2105. }
  2106. innerWireType := int(innerWire & 0x7)
  2107. if innerWireType == 4 {
  2108. break
  2109. }
  2110. next, err := skipCa(dAtA[start:])
  2111. if err != nil {
  2112. return 0, err
  2113. }
  2114. iNdEx = start + next
  2115. }
  2116. return iNdEx, nil
  2117. case 4:
  2118. return iNdEx, nil
  2119. case 5:
  2120. iNdEx += 4
  2121. return iNdEx, nil
  2122. default:
  2123. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  2124. }
  2125. }
  2126. panic("unreachable")
  2127. }
  2128. var (
  2129. ErrInvalidLengthCa = fmt.Errorf("proto: negative length found during unmarshaling")
  2130. ErrIntOverflowCa = fmt.Errorf("proto: integer overflow")
  2131. )
  2132. func init() { proto.RegisterFile("github.com/docker/swarmkit/api/ca.proto", fileDescriptorCa) }
  2133. var fileDescriptorCa = []byte{
  2134. // 638 bytes of a gzipped FileDescriptorProto
  2135. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xc1, 0x6e, 0xd3, 0x4c,
  2136. 0x10, 0xee, 0xba, 0xfd, 0xd3, 0xbf, 0xd3, 0xd0, 0xa2, 0xa5, 0x95, 0x4c, 0x9a, 0x3a, 0x95, 0x39,
  2137. 0xb4, 0x20, 0x61, 0xb7, 0x01, 0x09, 0x09, 0x2e, 0x24, 0x41, 0xaa, 0x2a, 0x54, 0x84, 0xb6, 0x82,
  2138. 0x6b, 0xe5, 0x38, 0xdb, 0x74, 0x15, 0xc7, 0x6b, 0xbc, 0xeb, 0x42, 0x6e, 0x48, 0x20, 0xde, 0x00,
  2139. 0xc1, 0x89, 0x47, 0xe0, 0x39, 0x2a, 0x4e, 0x48, 0x5c, 0x38, 0x55, 0xd4, 0x0f, 0xc0, 0x33, 0x20,
  2140. 0xaf, 0x6d, 0x9a, 0xb4, 0x4e, 0x5a, 0x4e, 0xf1, 0xce, 0x7c, 0xdf, 0x37, 0x33, 0xdf, 0x4e, 0x16,
  2141. 0xd6, 0xbb, 0x4c, 0x1e, 0x46, 0x6d, 0xcb, 0xe5, 0x7d, 0xbb, 0xc3, 0xdd, 0x1e, 0x0d, 0x6d, 0xf1,
  2142. 0xda, 0x09, 0xfb, 0x3d, 0x26, 0x6d, 0x27, 0x60, 0xb6, 0xeb, 0x58, 0x41, 0xc8, 0x25, 0xc7, 0x38,
  2143. 0xcd, 0x5a, 0x79, 0xd6, 0x3a, 0xda, 0xaa, 0xdc, 0xb9, 0x84, 0x2c, 0x07, 0x01, 0x15, 0x29, 0xff,
  2144. 0x52, 0xac, 0x08, 0xa8, 0x9b, 0x63, 0x97, 0xba, 0xbc, 0xcb, 0xd5, 0xa7, 0x9d, 0x7c, 0x65, 0xd1,
  2145. 0x07, 0x13, 0x14, 0x14, 0xa2, 0x1d, 0x1d, 0xd8, 0x81, 0x17, 0x75, 0x99, 0x9f, 0xfd, 0xa4, 0x44,
  2146. 0xb3, 0x05, 0xd5, 0x67, 0xbc, 0x43, 0x5b, 0x34, 0x94, 0xec, 0x80, 0xb9, 0x8e, 0xa4, 0x7b, 0xd2,
  2147. 0x91, 0x91, 0x20, 0xf4, 0x55, 0x44, 0x85, 0xc4, 0xb7, 0x60, 0xd6, 0xe7, 0x1d, 0xba, 0xcf, 0x3a,
  2148. 0x3a, 0x5a, 0x43, 0x1b, 0x73, 0x4d, 0x88, 0x4f, 0x6a, 0xa5, 0x84, 0xb2, 0xf3, 0x84, 0x94, 0x92,
  2149. 0xd4, 0x4e, 0xc7, 0xfc, 0x82, 0x60, 0x75, 0x8c, 0x8a, 0x08, 0xb8, 0x2f, 0x28, 0x7e, 0x08, 0x25,
  2150. 0xa1, 0x22, 0x4a, 0x65, 0xbe, 0x6e, 0x5a, 0x17, 0x2d, 0xb3, 0x76, 0x84, 0x88, 0x1c, 0xdf, 0xcd,
  2151. 0xb9, 0x19, 0x03, 0x37, 0x60, 0xde, 0x3d, 0x13, 0xd6, 0x35, 0x25, 0x50, 0x2b, 0x12, 0x18, 0xaa,
  2152. 0x4f, 0x86, 0x39, 0xe6, 0x0f, 0x04, 0x2b, 0x89, 0x3a, 0x3d, 0xd7, 0x65, 0x3e, 0xe5, 0x7d, 0x98,
  2153. 0x09, 0xb9, 0x47, 0x55, 0x73, 0x0b, 0xf5, 0x6a, 0x91, 0x76, 0xc2, 0x24, 0xdc, 0xa3, 0x4d, 0x4d,
  2154. 0x47, 0x44, 0xa1, 0xf1, 0x4d, 0x98, 0x76, 0x45, 0xa8, 0x1a, 0x2a, 0x37, 0x67, 0xe3, 0x93, 0xda,
  2155. 0x74, 0x6b, 0x8f, 0x90, 0x24, 0x86, 0x97, 0xe0, 0x3f, 0xc9, 0x7b, 0xd4, 0xd7, 0xa7, 0x13, 0xd3,
  2156. 0x48, 0x7a, 0xc0, 0xbb, 0x50, 0x76, 0x8e, 0x1c, 0xe6, 0x39, 0x6d, 0xe6, 0x31, 0x39, 0xd0, 0x67,
  2157. 0x54, 0xb9, 0xdb, 0xe3, 0xca, 0xed, 0x05, 0xd4, 0xb5, 0x1a, 0x43, 0x04, 0x32, 0x42, 0x37, 0x3f,
  2158. 0x22, 0xa8, 0x16, 0x4f, 0x95, 0xb9, 0x7e, 0x95, 0xcb, 0xc3, 0xcf, 0x61, 0x51, 0x81, 0xfa, 0xb4,
  2159. 0xdf, 0xa6, 0xa1, 0x38, 0x64, 0x81, 0x9a, 0x68, 0xa1, 0xbe, 0x3e, 0xb1, 0xaf, 0xdd, 0xbf, 0x70,
  2160. 0xb2, 0x90, 0xf0, 0xcf, 0xce, 0xe6, 0x2a, 0xac, 0x6c, 0x53, 0x49, 0x38, 0x97, 0xad, 0xc6, 0x45,
  2161. 0xb3, 0xcd, 0xc7, 0x50, 0x2d, 0x4e, 0x67, 0x5d, 0xaf, 0x8d, 0xde, 0x77, 0xd2, 0x79, 0x79, 0xf4,
  2162. 0x3a, 0x97, 0xe1, 0xc6, 0x36, 0x95, 0x2f, 0x7c, 0x8f, 0xbb, 0xbd, 0xa7, 0x74, 0x90, 0x0b, 0x87,
  2163. 0xb0, 0x34, 0x1a, 0xce, 0x04, 0x57, 0x01, 0x22, 0x15, 0xdc, 0xef, 0xd1, 0x41, 0xa6, 0x37, 0x17,
  2164. 0xe5, 0x30, 0xfc, 0x08, 0x66, 0x8f, 0x68, 0x28, 0x18, 0xf7, 0xb3, 0xdd, 0x5a, 0x29, 0x1a, 0xfc,
  2165. 0x65, 0x0a, 0x69, 0xce, 0x1c, 0x9f, 0xd4, 0xa6, 0x48, 0xce, 0xa8, 0xbf, 0xd7, 0x40, 0x6b, 0x35,
  2166. 0xf0, 0x3b, 0xa4, 0x6a, 0x5f, 0x18, 0x0a, 0xdb, 0x45, 0x5a, 0x13, 0xdc, 0xa9, 0x6c, 0x5e, 0x9d,
  2167. 0x90, 0x8e, 0x67, 0xfe, 0xff, 0xed, 0xeb, 0xef, 0xcf, 0x9a, 0x76, 0x1d, 0xe1, 0x37, 0x50, 0x1e,
  2168. 0x36, 0x00, 0xaf, 0x8f, 0xd1, 0x3a, 0xef, 0x5c, 0x65, 0xe3, 0x72, 0x60, 0x56, 0x6c, 0x59, 0x15,
  2169. 0x5b, 0x84, 0x6b, 0x0a, 0x79, 0xb7, 0xef, 0xf8, 0x4e, 0x97, 0x86, 0xf5, 0x4f, 0x1a, 0xa8, 0xbd,
  2170. 0xca, 0xac, 0x28, 0xda, 0xca, 0x62, 0x2b, 0x26, 0xfc, 0x2b, 0x8b, 0xad, 0x98, 0xb4, 0xf0, 0x43,
  2171. 0x56, 0x7c, 0x40, 0xb0, 0x5c, 0xf8, 0x24, 0xe1, 0xcd, 0x71, 0x6b, 0x3d, 0xee, 0x0d, 0xac, 0x6c,
  2172. 0xfd, 0x03, 0xe3, 0x7c, 0x23, 0x4d, 0xfd, 0xf8, 0xd4, 0x98, 0xfa, 0x79, 0x6a, 0x4c, 0xbd, 0x8d,
  2173. 0x0d, 0x74, 0x1c, 0x1b, 0xe8, 0x7b, 0x6c, 0xa0, 0x5f, 0xb1, 0x81, 0xda, 0x25, 0xf5, 0x02, 0xdf,
  2174. 0xfb, 0x13, 0x00, 0x00, 0xff, 0xff, 0xe1, 0xda, 0xca, 0xba, 0x67, 0x06, 0x00, 0x00,
  2175. }