Просмотр исходного кода

Merge pull request #344 from smiclea/fix-duplicate

Fix 'Duplicate Endpoint' not using secrets
Dorin Paslaru 7 лет назад
Родитель
Сommit
fe8c7b2d55
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      src/sources/EndpointSource.js

+ 4 - 2
src/sources/EndpointSource.js

@@ -117,8 +117,10 @@ class EdnpointSource {
   static update(endpoint: Endpoint): Promise<Endpoint> {
   static update(endpoint: Endpoint): Promise<Endpoint> {
     let parsedEndpoint = SchemaParser.fieldsToPayload(endpoint)
     let parsedEndpoint = SchemaParser.fieldsToPayload(endpoint)
 
 
-    if (parsedEndpoint.connectionInfo && Object.keys(parsedEndpoint.connectionInfo).length > 0 && parsedEndpoint.connection_info.secret_ref) {
+    if (parsedEndpoint.connection_info && Object.keys(parsedEndpoint.connection_info).length > 0 && parsedEndpoint.connection_info.secret_ref) {
+      // $FlowIgnore
       let uuidIndex = parsedEndpoint.connection_info.secret_ref.lastIndexOf('/')
       let uuidIndex = parsedEndpoint.connection_info.secret_ref.lastIndexOf('/')
+      // $FlowIgnore
       let uuid = parsedEndpoint.connection_info.secret_ref.substr(uuidIndex + 1)
       let uuid = parsedEndpoint.connection_info.secret_ref.substr(uuidIndex + 1)
       let newEndpoint: any = {}
       let newEndpoint: any = {}
       let connectionInfo = {}
       let connectionInfo = {}
@@ -178,7 +180,7 @@ class EdnpointSource {
     let newEndpoint: any = {}
     let newEndpoint: any = {}
     let connectionInfo = {}
     let connectionInfo = {}
     if (configLoader.config.useBarbicanSecrets
     if (configLoader.config.useBarbicanSecrets
-      && parsedEndpoint.connectionInfo && Object.keys(parsedEndpoint.connectionInfo).length > 0) {
+      && parsedEndpoint.connection_info && Object.keys(parsedEndpoint.connection_info).length > 0) {
       return Api.send({
       return Api.send({
         url: `${servicesUrl.barbican}/v1/secrets`,
         url: `${servicesUrl.barbican}/v1/secrets`,
         method: 'POST',
         method: 'POST',