Table of Contents

Class ExtensionsClient

Namespace
RDCore.SDK.Extensibility
Assembly
RDCore.SDK.dll

An extensions provider service that manages the extensions of a RDCoreExtensionServerApp.

public class ExtensionsClient : IExtensionsProvider
Inheritance
ExtensionsClient
Implements
Inherited Members

Constructors

ExtensionsClient(IOptions<SdkAppOptions>, IExtensionManifestValidationService, IFileSystem, IPlatformEnvironment, ILogger<ExtensionsClient>)

An extensions provider service that manages the extensions of a RDCoreExtensionServerApp.

public ExtensionsClient(IOptions<SdkAppOptions> options, IExtensionManifestValidationService validation, IFileSystem fileSystem, IPlatformEnvironment environment, ILogger<ExtensionsClient> logger)

Parameters

options IOptions<SdkAppOptions>

The extensions configuration settings.

validation IExtensionManifestValidationService

A service that validates an extension manifest.

fileSystem IFileSystem

Abstracts the file system.

environment IPlatformEnvironment

The platform environment the extensions are found in.

logger ILogger<ExtensionsClient>

The service's logger.

Methods

Allow(ExtensionInfo)

Enables the specified ExtensionInfo if the manifest and associated executable pass validation.

public bool Allow(ExtensionInfo extension)

Parameters

extension ExtensionInfo

The deserialized manifest of the extension to enable.

Returns

bool

true if the specified extension passed validation and was enabled, false otherwise.

Block(ExtensionInfo)

Disables the specified ExtensionInfo.

public bool Block(ExtensionInfo extension)

Parameters

extension ExtensionInfo

The deserialized manifest of the extension to disable.

Returns

bool

true if the specified extension could be disabled, false otherwise.

Describe(string, string)

Creates a serializable ExtensionInfo model for the specified extension executable name, with the specified description.

public ExtensionInfo? Describe(string name, string description)

Parameters

name string

The file name of the extension's executable: RDCore.Diagnostics.exe on Windows, RDCore.Diagnostics elsewhere. Its assembly is the .dll of the same name beside it.

description string

A short description of the extension.

Returns

ExtensionInfo

null if the specified extension cannot be described.

Remarks

The implementation validates that it is executing this method inside the target extension folder.

Discover()

Scans the extensions folder for subfolders containing an extension manifest.

public IEnumerable<ExtensionInfo> Discover()

Returns

IEnumerable<ExtensionInfo>

Returns all discovered valid extensions.

Remarks

An extension is found only when its diagnostic prefix (DiagnosticPrefix) is its own, whatever the order of the folders:

  • RDC belongs to the core extension, the one the platform manifest bundles (CoreExtension): another extension that declares it is not found;
  • RDX is the first-party extensions' prefix, and the one prefix that several extensions may declare;
  • the language's own prefixes (VBC, VBR, VBA) belong to the platform: an extension that declares one is not found;
  • when two extensions declare the same other prefix, neither is found;
  • an extension whose prefix is not three letters A to Z is not found.

A warning is logged for each extension that is not found because of its prefix.