Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,24 @@ public OidcConfiguration(
EndPoints = Ensure.IsNotNullOrEmpty(endPoints, nameof(endPoints));
Ensure.IsNotNull(authMechanismProperties, nameof(authMechanismProperties));
PrincipalName = principalName;

if (authMechanismProperties != null)
foreach (var authorizationProperty in authMechanismProperties)
{
foreach (var authorizationProperty in authMechanismProperties)
switch (authorizationProperty.Key)
{
switch (authorizationProperty.Key)
{
case CallbackMechanismPropertyName:
Callback = GetProperty<IOidcCallback>(authorizationProperty);
break;
case EnvironmentMechanismPropertyName:
Environment = GetProperty<string>(authorizationProperty);
break;
case TokenResourceMechanismPropertyName:
TokenResource = GetProperty<string>(authorizationProperty);
break;
default:
throw new ArgumentException(
$"Unknown OIDC property '{authorizationProperty.Key}'.",
authorizationProperty.Key);
}
case CallbackMechanismPropertyName:
Callback = GetProperty<IOidcCallback>(authorizationProperty);
break;
case EnvironmentMechanismPropertyName:
Environment = GetProperty<string>(authorizationProperty);
break;
case TokenResourceMechanismPropertyName:
TokenResource = GetProperty<string>(authorizationProperty);
break;
default:
throw new ArgumentException(
$"Unknown OIDC property '{authorizationProperty.Key}'.",
authorizationProperty.Key);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public BsonValue EncryptField(
contentionFactor: encryptOptions.ContentionFactor,
encryptOptions.Algorithm,
wrappedValueBytes,
ToBsonIfNotNull(encryptOptions?.RangeOptions?.CreateDocument()),
ToBsonIfNotNull(encryptOptions.RangeOptions?.CreateDocument()),
isExpressionMode);

using (context)
Expand Down Expand Up @@ -267,7 +267,7 @@ public async Task<BsonValue> EncryptFieldAsync(
contentionFactor: encryptOptions.ContentionFactor,
encryptOptions.Algorithm,
wrappedValueBytes,
ToBsonIfNotNull(encryptOptions?.RangeOptions?.CreateDocument()),
ToBsonIfNotNull(encryptOptions.RangeOptions?.CreateDocument()),
isExpressionMode);

using (context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ private BsonValue TranslateNewDateTime(NewExpression node)

return new BsonDocument("$dateFromParts", new BsonDocument
{
{ "year", year, year != null },
{ "year", year },
{ "month", month, month != null },
{ "day", day, day != null },
{ "hour", hour, hour != null },
Expand Down