@routr/common 2.2.0 → 2.4.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/dist/auth.d.ts CHANGED
@@ -1,14 +1,5 @@
1
- import { AuthChallengeRequest, AuthChallengeResponse, ResponseType } from "./types";
1
+ import { AuthChallengeResponse, ResponseType } from "./types";
2
2
  export declare const generateNonce: (algorithm?: string) => string;
3
- export declare const buildAuthChallenge: (request: AuthChallengeRequest) => {
4
- realm: string;
5
- scheme: "Digest";
6
- algorithm: "MD5";
7
- qop: import("./types").Qop;
8
- opaque: string;
9
- stale: boolean;
10
- nonce: string;
11
- };
12
3
  export declare const calculateAuthResponse: (res: AuthChallengeResponse, credentials: {
13
4
  username: string;
14
5
  secret: string;
package/dist/auth.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createForbideenResponse = exports.createServerInternalErrorResponse = exports.createUnauthorizedResponseWithoutChallenge = exports.createUnauthorizedResponse = exports.getCredentials = exports.calculateAuthResponse = exports.buildAuthChallenge = exports.generateNonce = void 0;
6
+ exports.createForbideenResponse = exports.createServerInternalErrorResponse = exports.createUnauthorizedResponseWithoutChallenge = exports.createUnauthorizedResponse = exports.getCredentials = exports.calculateAuthResponse = exports.generateNonce = void 0;
7
7
  /*
8
8
  * Copyright (C) 2023 by Fonoster Inc (https://fonoster.com)
9
9
  * http://github.com/fonoster/routr
@@ -29,19 +29,6 @@ const md5hex = (str, algorithm = DEFAULT_ALGORITHM) => crypto_1.default.createHa
29
29
  const decToHex = (dec) => (dec + Math.pow(16, 8)).toString(16).substr(-8);
30
30
  const generateNonce = (algorithm = DEFAULT_ALGORITHM) => md5hex(`${new Date().getTime()}${Math.random()}`, algorithm);
31
31
  exports.generateNonce = generateNonce;
32
- const buildAuthChallenge = (request) => {
33
- const { realm, scheme, algorithm, qop, opaque, stale } = request;
34
- return {
35
- realm,
36
- scheme,
37
- algorithm,
38
- qop,
39
- opaque,
40
- stale,
41
- nonce: (0, exports.generateNonce)(algorithm)
42
- };
43
- };
44
- exports.buildAuthChallenge = buildAuthChallenge;
45
32
  const calculateAuthResponse = (res, credentials) => {
46
33
  if (!credentials)
47
34
  return null;
@@ -50,7 +50,7 @@ message Route {
50
50
  repeated fonoster.routr.processor.v2beta1.NetInterface listening_points = 9;
51
51
  repeated string localnets = 10;
52
52
  repeated string external_addrs = 11;
53
- // During route creation, an endpoint can request to add labels than can later be
53
+ // During route creation, an endpoint can request to add labels that can later be
54
54
  // used as selectors. For example, a Softphone can add a label `priority=1` to indicate
55
55
  // that it is the preferred endpoint for the given AOR.
56
56
  map<string, string> labels = 12;
package/dist/types.d.ts CHANGED
@@ -86,16 +86,6 @@ export interface ObjectProto {
86
86
  path: string;
87
87
  version: string;
88
88
  }
89
- export interface AuthChallengeRequest {
90
- realm: string;
91
- domain: string;
92
- opaque: string;
93
- stale: boolean;
94
- nonce: string;
95
- scheme: AuthorizationScheme;
96
- algorithm: AuthorizationAlgorithm;
97
- qop: Qop;
98
- }
99
89
  export interface AuthChallengeResponse {
100
90
  realm: string;
101
91
  domain: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@routr/common",
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "description": "Common package",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/routr#readme",
@@ -55,5 +55,5 @@
55
55
  "devDependencies": {
56
56
  "@types/js-yaml": "^4.0.5"
57
57
  },
58
- "gitHead": "924c7d8711a7855635e52184d8ece28587febf48"
58
+ "gitHead": "704808be190e0fc8b07ceb3d98c15758c5c6c33c"
59
59
  }