pmcf 6.65.4 → 6.66.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.65.4",
3
+ "version": "6.66.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -171,7 +171,7 @@ export class CoreService extends base {
171
171
  continue;
172
172
  }
173
173
 
174
- if (e.pathname) {
174
+ if (e.scheme || e.pathname) {
175
175
  result.push(new HTTPEndpoint(this, na, options));
176
176
  } else {
177
177
  result.push(new Endpoint(this, na, options));
package/src/endpoint.mjs CHANGED
@@ -174,7 +174,8 @@ export class DomainNameEndpoint extends PortEndpoint {
174
174
  export class HTTPEndpoint extends BaseEndpoint {
175
175
  static name = "url_endpoint";
176
176
  static attributes = {
177
- url: url_attribute
177
+ url: url_attribute,
178
+ addressType: { ...string_attribute, name: "addressType" }
178
179
  };
179
180
 
180
181
  static {
@@ -186,6 +187,7 @@ export class HTTPEndpoint extends BaseEndpoint {
186
187
  * @param {Service} service
187
188
  * @param {string|URL} address
188
189
  * @param {object} data
190
+ * @param {string} data.scheme
189
191
  * @param {number} data.port
190
192
  * @param {string} data.pathname
191
193
  * @param {string} data.family
@@ -198,18 +200,22 @@ export class HTTPEndpoint extends BaseEndpoint {
198
200
  } else if (address instanceof URL) {
199
201
  this.url = address;
200
202
  } else {
203
+ this.networkAddress = address;
201
204
  this.family = data.family ?? address.family;
202
205
 
206
+ const scheme = data.scheme ? data.scheme : data.tls ? "https" : "http";
207
+
208
+ const domainName = [...address.domainNames][0];
209
+ const hostname =
210
+ domainName ??
211
+ (data.family === FAMILY_IPV6
212
+ ? "[" + address.address + "]"
213
+ : address.address);
214
+
203
215
  this.url = new URL(
204
- (data.tls ? "https://" : "http://") +
205
- (data.family === FAMILY_IPV6
206
- ? "[" + address.address + "]"
207
- : address.address) +
208
- ":" +
209
- data.port +
210
- (data.pathname ?? "/")
216
+ `${scheme}://${hostname}:${data.port}` + (data.pathname ?? "/")
211
217
  );
212
- this.hostname = address.address;
218
+ this.hostname = domainName ?? address.address;
213
219
  }
214
220
  }
215
221
 
@@ -236,6 +242,10 @@ export class HTTPEndpoint extends BaseEndpoint {
236
242
  return PROTOCOL_TCP;
237
243
  }
238
244
 
245
+ get addressType() {
246
+ return this.networkAddress?.type;
247
+ }
248
+
239
249
  get tls() {
240
250
  return this.url.toString().startsWith("https:");
241
251
  }
@@ -10,7 +10,7 @@ export class openldap extends CoreService {
10
10
  systemdService: "slapd.service",
11
11
  systemUserName: "ldap",
12
12
  systemGroupName: "ldap",
13
- extends: ["ldap", "ldapi"]
13
+ extends: ["ldap", "ldaps", "ldapi"]
14
14
  };
15
15
 
16
16
  static {