File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,25 @@ public static IFido2NetLibBuilder AddCachedMetadataService(this IFido2NetLibBuil
108
108
return builder ;
109
109
}
110
110
111
+ /// <summary>
112
+ /// Adds a custom metadata repository implementation to the FIDO2 builder.
113
+ /// </summary>
114
+ /// <typeparam name="T">The type of metadata repository to add. Must implement <see cref="IMetadataRepository"/>.</typeparam>
115
+ /// <param name="builder">The FIDO2 builder instance.</param>
116
+ /// <returns>The <see cref="IFido2NetLibBuilder"/> for method chaining.</returns>
117
+ /// <remarks>
118
+ /// This method registers the specified metadata repository implementation as a scoped service,
119
+ /// replacing any previously registered <see cref="IMetadataRepository"/>.
120
+ /// The repository provides metadata statements for authenticator validation and attestation verification.
121
+ /// </remarks>
122
+ /// <exception cref="ArgumentNullException">Thrown when <paramref name="builder"/> is null.</exception>
123
+ public static IFido2NetLibBuilder AddMetadataRepository < T > ( this IFido2NetLibBuilder builder )
124
+ where T : class , IMetadataRepository
125
+ {
126
+ builder . Services . AddScoped < IMetadataRepository , T > ( ) ;
127
+ return builder ;
128
+ }
129
+
111
130
/// <summary>
112
131
/// Adds a file system-based metadata repository to the FIDO2 builder.
113
132
/// </summary>
You can’t perform that action at this time.
0 commit comments