ca.pb.go 60 KB

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