venafi-connector-machine 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bundle.mjs +27 -0
  2. package/package.json +1 -1
package/bundle.mjs CHANGED
@@ -32887,6 +32887,10 @@ var TEMPLATES = {
32887
32887
  "// Always normalize through pem.EncodeToMemory() before returning \u2014 even if",
32888
32888
  "// the source is already PEM \u2014 to guarantee trailing newline and line wrapping.",
32889
32889
  '// 5. discoveryPage: null in the response signals "done" to the platform.',
32890
+ '// 6. Each DiscoveredCertificate MUST include an "installations" array with at least',
32891
+ "// one entry containing hostname, ipAddress, and port. Without this field, the",
32892
+ "// platform silently discards discovered certificates \u2014 no error, discovery shows",
32893
+ '// as "complete" but no certificates appear in the UI.',
32890
32894
  "",
32891
32895
  "package discovery",
32892
32896
  "",
@@ -32935,10 +32939,22 @@ var TEMPLATES = {
32935
32939
  "",
32936
32940
  "// DiscoveredCertificate represents a single certificate found during discovery.",
32937
32941
  "// CRITICAL: Use VALUE types (not pointers) \u2014 pointers serialize to null which the platform rejects.",
32942
+ "// CRITICAL: The Installations field is REQUIRED \u2014 without it, the platform silently discards",
32943
+ '// the certificate. Discovery will show as "complete" but no certs appear in the UI.',
32938
32944
  "type DiscoveredCertificate struct {",
32939
32945
  ' Certificate string `json:"certificate"` // PEM string (use pem.EncodeToMemory)',
32940
32946
  ' CertificateChain []string `json:"certificateChain"` // PEM strings, initialize with make()',
32941
32947
  ' MachineIdentities []MachineIdentity `json:"machineIdentities"` // VALUE type slice, initialize with make()',
32948
+ ' Installations []Installation `json:"installations"` // REQUIRED \u2014 at least one entry',
32949
+ "}",
32950
+ "",
32951
+ "// Installation identifies where the certificate was found (host + port).",
32952
+ "// CRITICAL: At least one Installation is required per DiscoveredCertificate.",
32953
+ "// Without this field, the platform silently drops the certificate from results.",
32954
+ "type Installation struct {",
32955
+ ' Hostname string `json:"hostname"`',
32956
+ ' IPAddress string `json:"ipAddress"`',
32957
+ ' Port int `json:"port"`',
32942
32958
  "}",
32943
32959
  "",
32944
32960
  "// MachineIdentity represents a certificate usage found during discovery.",
@@ -32972,6 +32988,11 @@ var TEMPLATES = {
32972
32988
  '// Keystore: domain.Keystore{CertificateName: "my-cert"},',
32973
32989
  '// Binding: domain.Binding{BindingType: "unbound"}, // never empty',
32974
32990
  "// }},",
32991
+ "// Installations: []Installation{{",
32992
+ "// Hostname: connection.HostnameOrAddress,",
32993
+ "// IPAddress: connection.HostnameOrAddress,",
32994
+ "// Port: connection.Port,",
32995
+ "// }}, // REQUIRED \u2014 without this, certs are silently dropped",
32975
32996
  "// })",
32976
32997
  "//",
32977
32998
  "// return c.JSON(http.StatusOK, DiscoverCertificatesResponse{",
@@ -33902,6 +33923,12 @@ ${LESSONS_LEARNED}
33902
33923
  24. **Certificate chain ordering is undocumented** \u2014 Venafi Cloud sends the chain array but the ordering guarantee is not documented. Pass through in received order and note this assumption. Targets with strict ordering requirements may need issuer/subject-based re-sorting
33903
33924
  25. **REST API discovery: convert base64 DER to PEM** \u2014 when a target API returns certs as base64-encoded DER, you MUST convert to PEM for the discovery response (\`base64.Decode \u2192 pem.EncodeToMemory\`). Validate with \`strings.HasPrefix(cert, "-----BEGIN CERTIFICATE-----")\`
33904
33925
  26. **Default binding must be assigned BEFORE discovery type filtering** \u2014 if "unbound" (or any fallback binding) is assigned after the filter runs, unbound certs are silently dropped. Always: find bindings \u2192 assign default if empty \u2192 then filter
33926
+ 27. **Discovery messages MUST include an \`installations\` array** \u2014 each DiscoveredCertificate must have at least one entry with hostname, ipAddress, and port. Without this field, the platform silently discards the certificate \u2014 discovery shows "complete" but no certs appear in the UI. This is the most common cause of "discovery works but nothing shows up"
33927
+ 28. **Connection reset after cert import = SUCCESS** \u2014 some targets restart their web gateway or management interface after a certificate is installed, causing connection resets, timeouts, or HTTP errors. These MUST be caught and treated as success, not failure. Add a short retry/delay if you need to verify the install afterward
33928
+ 29. **Idempotent install detection** \u2014 HTTP 409 or response body containing "already exists" / "identical" during cert import should be treated as success, not error. The certificate was already installed (e.g., from a previous attempt that reported a connection error)
33929
+ 30. **Error messages must attribute the component** \u2014 prefix all errors so users can identify which system caused the failure: \`"Target API error: ..."\` (target returned an error), \`"Target connection error: ..."\` (cannot reach target), \`"Connector error: ..."\` (invalid request or internal processing error). This saves significant support/debugging time
33930
+ 31. **Binding is optional in the manifest** \u2014 if your target has no binding concept (single-cert targets), you can omit binding from the domainSchema. However, if binding was ever defined and machines exist with binding data, you MUST keep at least \`{"properties": {}, "type": "object"}\` or the Venafi UI will crash when editing those machines. \`x-primaryKey\` is optional on binding when it has no properties, but always required on keystore
33931
+ 32. **Dropdowns use \`oneOf\` with \`const\`, not \`enum\`** \u2014 the correct manifest pattern for dropdown fields is \`"oneOf": [{"const": "value", "x-labelLocalizationKey": "field.value"}]\`. Using \`enum\` alone does not render labels in the UI
33905
33932
  `;
33906
33933
  }
33907
33934
  function getRESTClientPattern(args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "venafi-connector-machine",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "MCP server providing machine connector-specific knowledge, templates, and tools for building Venafi machine connectors",
5
5
  "main": "bundle.mjs",
6
6
  "type": "module",