Repository navigation
Plugin contract with metadata model - #31
Merged
Merged
Conversation
…com/AuthKits/AuthKit.Server into plugin-contract-with-metadata-model
Comment on lines
-53
to
+60
| var pluginName = Path.GetFileName(pluginDir); | ||
| var entryDllPath = Path.Combine(pluginDir, $"{pluginName}.dll"); | ||
| if (TryLoadPlugin(pluginDir, logger, hostVersion, loaded, out var plugin)) | ||
| { | ||
| loaded.Add(plugin); | ||
| logger.LogInformation("Loaded plugin '{Name}' v{Version} from {Dir}", plugin.Plugin.Name, plugin.Plugin.Version.ToString(), pluginDir); | ||
| } | ||
| } | ||
|
|
||
| return loaded; |
| var pluginName = Path.GetFileName(pluginDir); | ||
| var entryDllPath = Path.Combine(pluginDir, $"{pluginName}.dll"); | ||
|
|
||
| if (!File.Exists(entryDllPath)) |
Comment on lines
+138
to
142
| logger.LogError(ex, "Failed to load plugin from '{Dir}'.", pluginDir); | ||
| return false; | ||
| } | ||
| } | ||
|
|
| [ | ||
| Path.Combine(pluginDir, "manifest.json"), | ||
| Path.Combine(pluginDir, $"{pluginName}.manifest.json") | ||
| ]; |
| Path.Combine(pluginDir, "manifest.json"), | ||
| Path.Combine(pluginDir, $"{pluginName}.manifest.json") | ||
| ]; | ||
|
|
Comment on lines
+310
to
+314
| foreach (var c in value) | ||
| { | ||
| if (c is < '0' or > '9') | ||
| return false; | ||
| } |
Comment on lines
+50
to
+54
| catch (Exception ex) | ||
| { | ||
| errors.Add($"health: ConfigureServices threw: {ex.Message}"); | ||
| return errors; | ||
| } |
Comment on lines
+61
to
+64
| catch (Exception ex) | ||
| { | ||
| errors.Add($"health: CheckHealthAsync threw: {ex.Message}"); | ||
| } |
Comment on lines
+46
to
+52
| foreach (var pair in schemes) | ||
| { | ||
| if (pair.Key != pair.Value.Name) | ||
| { | ||
| errors.Add($"security schemes: key '{pair.Key}' does not match descriptor Name '{pair.Value.Name}'"); | ||
| } | ||
| } |
Comment on lines
+54
to
+57
| catch (Exception ex) | ||
| { | ||
| errors.Add($"security schemes: GetSecuritySchemes threw: {ex.Message}"); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends the AuthKit plugin contract with first-class metadata, semantic versioning, manifest support, and contract validation.
IAuthKitPluginwith stable identity, descriptive metadata, versioning, capabilities, dependencies, activation priority, enablement, and host compatibilityPluginMetadataandPluginManifestmodelsSemanticVersionimplementation following SemVer 2.0.0 precedence rulesContractsandModelsnamespacesPluginContractValidatorwith dedicated validation rules for plugin metadata, middleware, health, registration, and security schemesPlugin Contract
IAuthKitPluginwith stable plugin identity throughIdandNameDisplayNameandDescriptionfor human-readable plugin informationSemanticVersionAuthor,License,LicenseUrl,Homepage, andRepositoryUrlmetadataTagsfor plugin classification and catalog filteringPriorityfor activation ordering among dependency-ready pluginsIsEnabledto allow plugins to be disabled before activationCapabilitiesfor feature/capability declaration and negotiationMinHostVersionfor host compatibility checksDependsOnfor explicit plugin dependency declarationPlugin Metadata & Manifest Models
PluginMetadataas the normalized metadata representation of a pluginPluginManifestfor metadata available before plugin assembly activationIAuthKitPluginimplementationSemantic Versioning
SemanticVersionimplementing SemVer 2.0.0 parsing and precedence comparisonSemanticVersionJsonConverterfor manifest and configuration serializationPlugin Validation
PluginContractValidatortool for validating plugin assemblies independently of the hostHost Discovery & Loading
IAuthKitPluginLoadedPluginto carry the expanded plugin metadata required by the new contractPlugin Organization
IAuthKitPluginintoContractsContracts.SecuritySchemesContracts.Pluginshelpers for plugin operations and metadataModelsnamespace forPluginMetadata,PluginManifest, and semantic version typesIAuthKitPluginlocation in favor of the structured contract namespaceDevTokens Plugin
DevTokensPluginto implement the expanded plugin metadata contractIAuthKitPluginabstractionBuild & Development
src/project layoutPluginContractValidatorin the solution/container restore graphResult
PluginContractValidatorCloses #25
Closes #24
Closes #23
Closes #26