@benzenejs/mesh-discovery-azure 0.0.0-stage → 0.1.0-beta.2
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/AzureAppServiceDiscoveryProvider.d.ts +25 -0
- package/dist/AzureAppServiceDiscoveryProvider.js +81 -0
- package/dist/AzureArmResourceLister.d.ts +27 -0
- package/dist/AzureArmResourceLister.js +58 -0
- package/dist/Extensions.d.ts +16 -0
- package/dist/Extensions.js +35 -0
- package/dist/IAzureResourceLister.d.ts +28 -0
- package/dist/IAzureResourceLister.js +7 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +27 -0
- package/package.json +16 -4
- package/README.md +0 -3
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Port of Benzene.Mesh.Discovery.Azure.AzureAppServiceDiscoveryProvider. */
|
|
2
|
+
import { IMeshDiscoveryProvider, MeshDiscoveryFilter, MeshServiceRegistryEntry } from '@benzenejs/mesh-contracts';
|
|
3
|
+
import { IAzureResourceLister } from './IAzureResourceLister';
|
|
4
|
+
/**
|
|
5
|
+
* Discovers Benzene services by enumerating the Azure App Service / Function App resources
|
|
6
|
+
* (`Microsoft.Web/sites`) in a subscription, keeping those that match the `MeshDiscoveryFilter` (by default,
|
|
7
|
+
* carry the `benzene` tag), and emitting an HTTP registry entry per site at its default hostname
|
|
8
|
+
* (`https://{host}/benzene/spec|health`). App Services are HTTP-addressable, so entries use the default HTTP
|
|
9
|
+
* interrogation source (`MeshServiceSource.http`) - the aggregator's `HttpMeshServiceSource` interrogates each.
|
|
10
|
+
*
|
|
11
|
+
* A site's host defaults to `{name}.azurewebsites.net`; override it (custom domain) with the `benzene:host`
|
|
12
|
+
* tag, and the spec/health paths with `benzene:spec-path`/`benzene:health-path`.
|
|
13
|
+
*/
|
|
14
|
+
export declare class AzureAppServiceDiscoveryProvider implements IMeshDiscoveryProvider {
|
|
15
|
+
private readonly lister;
|
|
16
|
+
/** Tag overriding the host (default `{name}.azurewebsites.net`). */
|
|
17
|
+
static readonly HostTag = "benzene:host";
|
|
18
|
+
/** Tag overriding the spec path (default `/benzene/spec?type=benzene`). */
|
|
19
|
+
static readonly SpecPathTag = "benzene:spec-path";
|
|
20
|
+
/** Tag overriding the health path (default `/benzene/health`). */
|
|
21
|
+
static readonly HealthPathTag = "benzene:health-path";
|
|
22
|
+
constructor(lister: IAzureResourceLister);
|
|
23
|
+
get key(): string;
|
|
24
|
+
discoverAsync(filter: MeshDiscoveryFilter, cancellationToken?: AbortSignal): Promise<readonly MeshServiceRegistryEntry[]>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AzureAppServiceDiscoveryProvider = void 0;
|
|
4
|
+
/** Port of Benzene.Mesh.Discovery.Azure.AzureAppServiceDiscoveryProvider. */
|
|
5
|
+
const mesh_contracts_1 = require("@benzenejs/mesh-contracts");
|
|
6
|
+
const DefaultSpecPath = '/benzene/spec?type=benzene';
|
|
7
|
+
const DefaultHealthPath = '/benzene/health';
|
|
8
|
+
/**
|
|
9
|
+
* Discovers Benzene services by enumerating the Azure App Service / Function App resources
|
|
10
|
+
* (`Microsoft.Web/sites`) in a subscription, keeping those that match the `MeshDiscoveryFilter` (by default,
|
|
11
|
+
* carry the `benzene` tag), and emitting an HTTP registry entry per site at its default hostname
|
|
12
|
+
* (`https://{host}/benzene/spec|health`). App Services are HTTP-addressable, so entries use the default HTTP
|
|
13
|
+
* interrogation source (`MeshServiceSource.http`) - the aggregator's `HttpMeshServiceSource` interrogates each.
|
|
14
|
+
*
|
|
15
|
+
* A site's host defaults to `{name}.azurewebsites.net`; override it (custom domain) with the `benzene:host`
|
|
16
|
+
* tag, and the spec/health paths with `benzene:spec-path`/`benzene:health-path`.
|
|
17
|
+
*/
|
|
18
|
+
class AzureAppServiceDiscoveryProvider {
|
|
19
|
+
lister;
|
|
20
|
+
/** Tag overriding the host (default `{name}.azurewebsites.net`). */
|
|
21
|
+
static HostTag = 'benzene:host';
|
|
22
|
+
/** Tag overriding the spec path (default `/benzene/spec?type=benzene`). */
|
|
23
|
+
static SpecPathTag = 'benzene:spec-path';
|
|
24
|
+
/** Tag overriding the health path (default `/benzene/health`). */
|
|
25
|
+
static HealthPathTag = 'benzene:health-path';
|
|
26
|
+
constructor(lister) {
|
|
27
|
+
this.lister = lister;
|
|
28
|
+
}
|
|
29
|
+
get key() {
|
|
30
|
+
return 'Azure';
|
|
31
|
+
}
|
|
32
|
+
async discoverAsync(filter, cancellationToken) {
|
|
33
|
+
const resources = await this.lister.listWebAppsAsync(cancellationToken);
|
|
34
|
+
const entries = [];
|
|
35
|
+
for (const resource of resources) {
|
|
36
|
+
if (!filter.matches(resource.tags)) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (filter.regions !== undefined &&
|
|
40
|
+
resource.location !== undefined &&
|
|
41
|
+
!filter.regions.some((region) => region.toLowerCase() === resource.location.toLowerCase())) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const defaultHost = resource.defaultHost ?? `${resource.name}.azurewebsites.net`;
|
|
45
|
+
const host = sanitizeHost(tagOrDefault(resource.tags, AzureAppServiceDiscoveryProvider.HostTag, defaultHost), defaultHost);
|
|
46
|
+
const specPath = sanitizePath(tagOrDefault(resource.tags, AzureAppServiceDiscoveryProvider.SpecPathTag, DefaultSpecPath), DefaultSpecPath);
|
|
47
|
+
const healthPath = sanitizePath(tagOrDefault(resource.tags, AzureAppServiceDiscoveryProvider.HealthPathTag, DefaultHealthPath), DefaultHealthPath);
|
|
48
|
+
entries.push(new mesh_contracts_1.MeshServiceRegistryEntry(resource.name, `https://${host}${specPath}`, `https://${host}${healthPath}`));
|
|
49
|
+
}
|
|
50
|
+
return entries;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.AzureAppServiceDiscoveryProvider = AzureAppServiceDiscoveryProvider;
|
|
54
|
+
function tagOrDefault(tags, key, fallback) {
|
|
55
|
+
const value = tags[key];
|
|
56
|
+
return value !== undefined && value.trim().length > 0 ? value : fallback;
|
|
57
|
+
}
|
|
58
|
+
// A host tag carries an attacker-influenceable value (anyone who can tag the resource). Reject anything that
|
|
59
|
+
// isn't a bare host[:port] authority: a value carrying a path, scheme, userinfo, or whitespace/CRLF could
|
|
60
|
+
// otherwise restructure the "https://{host}{path}" URL and point the aggregator's fetch at a different host
|
|
61
|
+
// (SSRF). An invalid override falls back to the safe default host rather than aborting the whole sweep.
|
|
62
|
+
function sanitizeHost(host, fallback) {
|
|
63
|
+
return isBareAuthority(host) ? host : fallback;
|
|
64
|
+
}
|
|
65
|
+
function isBareAuthority(value) {
|
|
66
|
+
if (value.trim().length === 0) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
for (const c of value) {
|
|
70
|
+
if (c === '/' || c === '\\' || c === '@' || c === '?' || c === '#' || /\s/.test(c)) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
// A path override must be a real path (start with '/'); otherwise "{host}{path}" would graft the value onto
|
|
77
|
+
// the host - e.g. ".evil.com/spec" makes "myapp.azurewebsites.net.evil.com/spec" - and redirect the fetch
|
|
78
|
+
// off-host. An invalid override falls back to the safe default path.
|
|
79
|
+
function sanitizePath(path, fallback) {
|
|
80
|
+
return path.startsWith('/') ? path : fallback;
|
|
81
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Port of Benzene.Mesh.Discovery.Azure.AzureArmResourceLister. */
|
|
2
|
+
import { ResourceManagementClient } from '@azure/arm-resources';
|
|
3
|
+
import { AzureResourceInfo, IAzureResourceLister } from './IAzureResourceLister';
|
|
4
|
+
/**
|
|
5
|
+
* The real `IAzureResourceLister` over Azure Resource Manager. Kept thin (no discovery logic) so the SDK
|
|
6
|
+
* coupling lives in one place and `AzureAppServiceDiscoveryProvider` stays unit-testable against the port.
|
|
7
|
+
* Enumerates the `Microsoft.Web/sites` resources in a subscription, optionally constrained to one resource
|
|
8
|
+
* group.
|
|
9
|
+
*
|
|
10
|
+
* `Azure.ResourceManager` -> `@azure/arm-resources` (the JS-ecosystem equivalent). Divergence: C#'s
|
|
11
|
+
* `ArmClient` is tenant-scoped and picks the subscription per call (`GetDefaultSubscriptionAsync`), whereas
|
|
12
|
+
* JS's `ResourceManagementClient` is *subscription-scoped at construction* - so the subscription choice
|
|
13
|
+
* moves to where the client is built (`addMeshAzureDiscovery`), and this lister only holds the optional
|
|
14
|
+
* resource-group filter. The resource group isn't a field on the list item, so it's parsed from the ARM id.
|
|
15
|
+
* Deployment slots (`Microsoft.Web/sites/slots`) are a distinct resource type and never returned; Function
|
|
16
|
+
* Apps are `Microsoft.Web/sites` and are returned when tagged (the tag filter is the gate).
|
|
17
|
+
*/
|
|
18
|
+
export declare class AzureArmResourceLister implements IAzureResourceLister {
|
|
19
|
+
private readonly client;
|
|
20
|
+
private readonly resourceGroup;
|
|
21
|
+
/**
|
|
22
|
+
* @param client The subscription-scoped ARM client.
|
|
23
|
+
* @param resourceGroup If set, only sites in this resource group are returned (matched case-insensitively).
|
|
24
|
+
*/
|
|
25
|
+
constructor(client: ResourceManagementClient, resourceGroup?: string);
|
|
26
|
+
listWebAppsAsync(_cancellationToken?: AbortSignal): Promise<AzureResourceInfo[]>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AzureArmResourceLister = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The real `IAzureResourceLister` over Azure Resource Manager. Kept thin (no discovery logic) so the SDK
|
|
6
|
+
* coupling lives in one place and `AzureAppServiceDiscoveryProvider` stays unit-testable against the port.
|
|
7
|
+
* Enumerates the `Microsoft.Web/sites` resources in a subscription, optionally constrained to one resource
|
|
8
|
+
* group.
|
|
9
|
+
*
|
|
10
|
+
* `Azure.ResourceManager` -> `@azure/arm-resources` (the JS-ecosystem equivalent). Divergence: C#'s
|
|
11
|
+
* `ArmClient` is tenant-scoped and picks the subscription per call (`GetDefaultSubscriptionAsync`), whereas
|
|
12
|
+
* JS's `ResourceManagementClient` is *subscription-scoped at construction* - so the subscription choice
|
|
13
|
+
* moves to where the client is built (`addMeshAzureDiscovery`), and this lister only holds the optional
|
|
14
|
+
* resource-group filter. The resource group isn't a field on the list item, so it's parsed from the ARM id.
|
|
15
|
+
* Deployment slots (`Microsoft.Web/sites/slots`) are a distinct resource type and never returned; Function
|
|
16
|
+
* Apps are `Microsoft.Web/sites` and are returned when tagged (the tag filter is the gate).
|
|
17
|
+
*/
|
|
18
|
+
class AzureArmResourceLister {
|
|
19
|
+
client;
|
|
20
|
+
resourceGroup;
|
|
21
|
+
/**
|
|
22
|
+
* @param client The subscription-scoped ARM client.
|
|
23
|
+
* @param resourceGroup If set, only sites in this resource group are returned (matched case-insensitively).
|
|
24
|
+
*/
|
|
25
|
+
constructor(client, resourceGroup) {
|
|
26
|
+
this.client = client;
|
|
27
|
+
this.resourceGroup = resourceGroup !== undefined && resourceGroup.trim().length > 0 ? resourceGroup : undefined;
|
|
28
|
+
}
|
|
29
|
+
async listWebAppsAsync(_cancellationToken) {
|
|
30
|
+
const resources = [];
|
|
31
|
+
for await (const resource of this.client.resources.list({ filter: "resourceType eq 'Microsoft.Web/sites'" })) {
|
|
32
|
+
// Scope to one resource group in code (the generic-resources $filter doesn't take a resource group),
|
|
33
|
+
// so a subscription-scoped Reader identity still only discovers the intended group.
|
|
34
|
+
if (this.resourceGroup !== undefined && !equalsIgnoreCase(resourceGroupOf(resource.id), this.resourceGroup)) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
resources.push({
|
|
38
|
+
name: resource.name ?? '',
|
|
39
|
+
location: resource.location,
|
|
40
|
+
defaultHost: undefined,
|
|
41
|
+
tags: resource.tags ?? {},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return resources;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.AzureArmResourceLister = AzureArmResourceLister;
|
|
48
|
+
/** Extracts the resource-group segment from an ARM resource id (`/subscriptions/.../resourceGroups/{rg}/...`). */
|
|
49
|
+
function resourceGroupOf(id) {
|
|
50
|
+
if (id === undefined) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
const match = /\/resourceGroups\/([^/]+)/i.exec(id);
|
|
54
|
+
return match ? match[1] : undefined;
|
|
55
|
+
}
|
|
56
|
+
function equalsIgnoreCase(a, b) {
|
|
57
|
+
return a !== undefined && a.toLowerCase() === b.toLowerCase();
|
|
58
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IBenzeneServiceContainer } from '@benzenejs/abstractions';
|
|
2
|
+
/**
|
|
3
|
+
* Registers `AzureAppServiceDiscoveryProvider` (as an additional `IMeshDiscoveryProvider`) over a
|
|
4
|
+
* `ResourceManagementClient` authenticated with `DefaultAzureCredential` (managed identity in Azure, the dev
|
|
5
|
+
* credential locally), plus a `MeshDiscoveryRunner` over all registered providers. The identity needs
|
|
6
|
+
* `Reader` on the resources it enumerates.
|
|
7
|
+
*
|
|
8
|
+
* Divergence from C#: JS's `ResourceManagementClient` is subscription-scoped at construction (there's no
|
|
9
|
+
* `GetDefaultSubscriptionAsync`), so a subscription id is required - passed here or read from the
|
|
10
|
+
* `AZURE_SUBSCRIPTION_ID` environment variable.
|
|
11
|
+
*
|
|
12
|
+
* @param subscriptionId The subscription to enumerate. Falls back to `AZURE_SUBSCRIPTION_ID`; required.
|
|
13
|
+
* @param resourceGroup If set, discovery is constrained to this resource group (recommended when the
|
|
14
|
+
* identity holds Reader at subscription scope).
|
|
15
|
+
*/
|
|
16
|
+
export declare function addMeshAzureDiscovery(services: IBenzeneServiceContainer, subscriptionId?: string, resourceGroup?: string): IBenzeneServiceContainer;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addMeshAzureDiscovery = addMeshAzureDiscovery;
|
|
4
|
+
/** Port of Benzene.Mesh.Discovery.Azure.Extensions. */
|
|
5
|
+
const arm_resources_1 = require("@azure/arm-resources");
|
|
6
|
+
const identity_1 = require("@azure/identity");
|
|
7
|
+
const mesh_contracts_1 = require("@benzenejs/mesh-contracts");
|
|
8
|
+
const AzureAppServiceDiscoveryProvider_1 = require("./AzureAppServiceDiscoveryProvider");
|
|
9
|
+
const AzureArmResourceLister_1 = require("./AzureArmResourceLister");
|
|
10
|
+
const IAzureResourceLister_1 = require("./IAzureResourceLister");
|
|
11
|
+
/**
|
|
12
|
+
* Registers `AzureAppServiceDiscoveryProvider` (as an additional `IMeshDiscoveryProvider`) over a
|
|
13
|
+
* `ResourceManagementClient` authenticated with `DefaultAzureCredential` (managed identity in Azure, the dev
|
|
14
|
+
* credential locally), plus a `MeshDiscoveryRunner` over all registered providers. The identity needs
|
|
15
|
+
* `Reader` on the resources it enumerates.
|
|
16
|
+
*
|
|
17
|
+
* Divergence from C#: JS's `ResourceManagementClient` is subscription-scoped at construction (there's no
|
|
18
|
+
* `GetDefaultSubscriptionAsync`), so a subscription id is required - passed here or read from the
|
|
19
|
+
* `AZURE_SUBSCRIPTION_ID` environment variable.
|
|
20
|
+
*
|
|
21
|
+
* @param subscriptionId The subscription to enumerate. Falls back to `AZURE_SUBSCRIPTION_ID`; required.
|
|
22
|
+
* @param resourceGroup If set, discovery is constrained to this resource group (recommended when the
|
|
23
|
+
* identity holds Reader at subscription scope).
|
|
24
|
+
*/
|
|
25
|
+
function addMeshAzureDiscovery(services, subscriptionId, resourceGroup) {
|
|
26
|
+
const resolvedSubscriptionId = subscriptionId ?? process.env['AZURE_SUBSCRIPTION_ID'];
|
|
27
|
+
if (resolvedSubscriptionId === undefined || resolvedSubscriptionId.trim().length === 0) {
|
|
28
|
+
throw new Error('addMeshAzureDiscovery requires a subscription id (pass one explicitly or set AZURE_SUBSCRIPTION_ID) - ' +
|
|
29
|
+
"the JS ResourceManagementClient is subscription-scoped and has no default-subscription resolution.");
|
|
30
|
+
}
|
|
31
|
+
services.addSingletonFactory(IAzureResourceLister_1.IAzureResourceLister, () => new AzureArmResourceLister_1.AzureArmResourceLister(new arm_resources_1.ResourceManagementClient(new identity_1.DefaultAzureCredential(), resolvedSubscriptionId), resourceGroup));
|
|
32
|
+
services.addSingletonFactory(mesh_contracts_1.IMeshDiscoveryProvider, (resolver) => new AzureAppServiceDiscoveryProvider_1.AzureAppServiceDiscoveryProvider(resolver.getService(IAzureResourceLister_1.IAzureResourceLister)));
|
|
33
|
+
services.addSingletonFactory(mesh_contracts_1.MeshDiscoveryRunner, (resolver) => new mesh_contracts_1.MeshDiscoveryRunner(resolver.getServices(mesh_contracts_1.IMeshDiscoveryProvider)));
|
|
34
|
+
return services;
|
|
35
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Port of Benzene.Mesh.Discovery.Azure.IAzureResourceLister (+ AzureResourceInfo). */
|
|
2
|
+
import { ServiceToken } from '@benzenejs/abstractions';
|
|
3
|
+
/**
|
|
4
|
+
* The subset of an Azure App Service / Function App resource that mesh discovery needs. C# `record` ->
|
|
5
|
+
* a plain interface; `IReadOnlyDictionary` -> `Record`; nullable strings -> `| undefined`.
|
|
6
|
+
*/
|
|
7
|
+
export interface AzureResourceInfo {
|
|
8
|
+
/** The resource name (used as the mesh service name and, by convention, its default host). */
|
|
9
|
+
readonly name: string;
|
|
10
|
+
/** The Azure region the resource is in (for region scoping), or `undefined` if unknown. */
|
|
11
|
+
readonly location: string | undefined;
|
|
12
|
+
/** The resource's default hostname if known (e.g. `orders.azurewebsites.net`), else `undefined`. */
|
|
13
|
+
readonly defaultHost: string | undefined;
|
|
14
|
+
/** The resource's tags (matched against the discovery filter). */
|
|
15
|
+
readonly tags: Record<string, string>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A minimal port over Azure Resource Manager for listing the App Service / Function App resources
|
|
19
|
+
* (`Microsoft.Web/sites`) in a subscription, so `AzureAppServiceDiscoveryProvider`'s discovery logic
|
|
20
|
+
* (tag/region filtering, URL building) is unit-testable without the Azure SDK. The real implementation is
|
|
21
|
+
* `AzureArmResourceLister`. `CancellationToken` -> optional `AbortSignal`.
|
|
22
|
+
*/
|
|
23
|
+
export interface IAzureResourceLister {
|
|
24
|
+
/** Lists the `Microsoft.Web/sites` resources in the subscription. */
|
|
25
|
+
listWebAppsAsync(cancellationToken?: AbortSignal): Promise<AzureResourceInfo[]>;
|
|
26
|
+
}
|
|
27
|
+
/** Container token: the discovery provider resolves its lister by this interface. */
|
|
28
|
+
export declare const IAzureResourceLister: ServiceToken<IAzureResourceLister>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IAzureResourceLister = void 0;
|
|
4
|
+
/** Port of Benzene.Mesh.Discovery.Azure.IAzureResourceLister (+ AzureResourceInfo). */
|
|
5
|
+
const abstractions_1 = require("@benzenejs/abstractions");
|
|
6
|
+
/** Container token: the discovery provider resolves its lister by this interface. */
|
|
7
|
+
exports.IAzureResourceLister = (0, abstractions_1.serviceToken)('IAzureResourceLister');
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Port of Benzene.Mesh.Discovery.Azure - self-discovery of Benzene services from Azure App Service /
|
|
3
|
+
* Function App resources (`Microsoft.Web/sites`). `AzureAppServiceDiscoveryProvider` (pure tag/region
|
|
4
|
+
* filtering + SSRF-safe URL building) sits over the `IAzureResourceLister` seam, whose real implementation
|
|
5
|
+
* (`AzureArmResourceLister`) adapts `Azure.ResourceManager` to `@azure/arm-resources`. Wired via
|
|
6
|
+
* `addMeshAzureDiscovery`.
|
|
7
|
+
*/
|
|
8
|
+
export * from './IAzureResourceLister';
|
|
9
|
+
export * from './AzureAppServiceDiscoveryProvider';
|
|
10
|
+
export * from './AzureArmResourceLister';
|
|
11
|
+
export * from './Extensions';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* Port of Benzene.Mesh.Discovery.Azure - self-discovery of Benzene services from Azure App Service /
|
|
19
|
+
* Function App resources (`Microsoft.Web/sites`). `AzureAppServiceDiscoveryProvider` (pure tag/region
|
|
20
|
+
* filtering + SSRF-safe URL building) sits over the `IAzureResourceLister` seam, whose real implementation
|
|
21
|
+
* (`AzureArmResourceLister`) adapts `Azure.ResourceManager` to `@azure/arm-resources`. Wired via
|
|
22
|
+
* `addMeshAzureDiscovery`.
|
|
23
|
+
*/
|
|
24
|
+
__exportStar(require("./IAzureResourceLister"), exports);
|
|
25
|
+
__exportStar(require("./AzureAppServiceDiscoveryProvider"), exports);
|
|
26
|
+
__exportStar(require("./AzureArmResourceLister"), exports);
|
|
27
|
+
__exportStar(require("./Extensions"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@benzenejs/mesh-discovery-azure",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-beta.2",
|
|
4
|
+
"description": "TypeScript port of Benzene.Mesh.Discovery.Azure",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@benzenejs/abstractions": "0.1.0-beta.2",
|
|
11
|
+
"@benzenejs/mesh-contracts": "0.1.0-beta.2",
|
|
12
|
+
"@azure/arm-resources": "^8.0.0",
|
|
13
|
+
"@azure/identity": "^4.13.1"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
]
|
|
18
|
+
}
|
package/README.md
DELETED