Skip to content

Commit d44fb84

Browse files
authored
Removed not released properties from validate-azure-ad-token (#142)
1 parent 40017b3 commit d44fb84

File tree

3 files changed

+0
-141
lines changed

3 files changed

+0
-141
lines changed

src/Authoring/Configs/ValidateAzureAdTokenConfig.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,6 @@ public record ValidateAzureAdTokenConfig
5050
/// </summary>
5151
public string? OutputTokenVariableName { get; init; }
5252

53-
/// <summary>
54-
/// Indicates whether to allow protected forwarded tokens.
55-
/// </summary>
56-
[ExpressionAllowed]
57-
public bool? AllowProtectedForwardedTokens { get; init; }
58-
59-
/// <summary>
60-
/// Indicates whether to allow proof of possession tokens.
61-
/// </summary>
62-
public bool? AllowProofOfPossessionTokes { get; init; }
63-
64-
/// <summary>
65-
/// The name of the variable to store the proof of possession token.
66-
/// </summary>
67-
public string? OutputPftTokenVariableName { get; init; }
68-
6953
/// <summary>
7054
/// The application IDs of the backend services.
7155
/// </summary>

src/Core/Compiling/Policy/ValidateAzureAdTokenCompiler.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,8 @@ public void Handle(ICompilationContext context, InvocationExpressionSyntax node)
4343
"failed-validation-httpcode");
4444
element.AddAttribute(values, nameof(ValidateAzureAdTokenConfig.FailedValidationErrorMessage),
4545
"failed-validation-error-message");
46-
element.AddAttribute(values, nameof(ValidateAzureAdTokenConfig.AllowProtectedForwardedTokens),
47-
"allow-protected-forwarded-tokens");
48-
element.AddAttribute(values, nameof(ValidateAzureAdTokenConfig.AllowProofOfPossessionTokes),
49-
"allow-proof-of-possession-tokens");
5046
element.AddAttribute(values, nameof(ValidateAzureAdTokenConfig.OutputTokenVariableName),
5147
"output-token-variable-name");
52-
element.AddAttribute(values, nameof(ValidateAzureAdTokenConfig.OutputPftTokenVariableName),
53-
"output-pft-token-variable-name");
5448

5549
GenericCompiler.HandleList(element, values, nameof(ValidateAzureAdTokenConfig.BackendApplicationIds),
5650
"backend-application-ids", "application-id");

test/Test.Core/Compiling/ValidateAzureAdTokenTests.cs

Lines changed: 0 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -310,125 +310,6 @@ public void Inbound(IInboundContext context) {
310310
""",
311311
DisplayName = "Should compile validate-azure-ad-token policy with output-token-variable-name"
312312
)]
313-
[DataRow(
314-
"""
315-
[Document]
316-
public class PolicyDocument : IDocument
317-
{
318-
public void Inbound(IInboundContext context) {
319-
context.ValidateAzureAdToken(new ValidateAzureAdTokenConfig
320-
{
321-
TenantId = "{{aad-tenant-id}}",
322-
AllowProtectedForwardedTokens = true
323-
});
324-
}
325-
}
326-
""",
327-
"""
328-
<policies>
329-
<inbound>
330-
<validate-azure-ad-token tenant-id="{{aad-tenant-id}}" allow-protected-forwarded-tokens="true" />
331-
</inbound>
332-
</policies>
333-
""",
334-
DisplayName = "Should compile validate-azure-ad-token policy with allow-protected-forwarded-tokens"
335-
)]
336-
[DataRow(
337-
"""
338-
[Document]
339-
public class PolicyDocument : IDocument
340-
{
341-
public void Inbound(IInboundContext context) {
342-
context.ValidateAzureAdToken(new ValidateAzureAdTokenConfig
343-
{
344-
TenantId = "{{aad-tenant-id}}",
345-
AllowProtectedForwardedTokens = GetAllowProtectedForwardedTokens(context.ExpressionContext)
346-
});
347-
}
348-
bool GetAllowProtectedForwardedTokens(IExpressionContext context) => (bool)context.Variable["allow-protected-forwarded-tokens"];
349-
}
350-
""",
351-
"""
352-
<policies>
353-
<inbound>
354-
<validate-azure-ad-token tenant-id="{{aad-tenant-id}}" allow-protected-forwarded-tokens="@((bool)context.Variable["allow-protected-forwarded-tokens"])" />
355-
</inbound>
356-
</policies>
357-
""",
358-
DisplayName =
359-
"Should compile validate-azure-ad-token policy with expression in allow-protected-forwarded-tokens"
360-
)]
361-
[DataRow(
362-
"""
363-
[Document]
364-
public class PolicyDocument : IDocument
365-
{
366-
public void Inbound(IInboundContext context) {
367-
context.ValidateAzureAdToken(new ValidateAzureAdTokenConfig
368-
{
369-
TenantId = "{{aad-tenant-id}}",
370-
AllowProofOfPossessionTokes = true
371-
});
372-
}
373-
}
374-
""",
375-
"""
376-
<policies>
377-
<inbound>
378-
<validate-azure-ad-token tenant-id="{{aad-tenant-id}}" allow-proof-of-possession-tokens="true" />
379-
</inbound>
380-
</policies>
381-
""",
382-
DisplayName = "Should compile validate-azure-ad-token policy with allow-proof-of-possession-tokens"
383-
)]
384-
[DataRow(
385-
"""
386-
[Document]
387-
public class PolicyDocument : IDocument
388-
{
389-
public void Inbound(IInboundContext context) {
390-
context.ValidateAzureAdToken(new ValidateAzureAdTokenConfig
391-
{
392-
TenantId = "{{aad-tenant-id}}",
393-
AllowProofOfPossessionTokes = GetAllowProofOfPossessionTokes(context.ExpressionContext)
394-
});
395-
}
396-
bool GetAllowProofOfPossessionTokes(IExpressionContext context) => (bool)context.Variable["allow-proof-of-possession-tokens"];
397-
}
398-
""",
399-
"""
400-
<policies>
401-
<inbound>
402-
<validate-azure-ad-token tenant-id="{{aad-tenant-id}}" allow-proof-of-possession-tokens="@((bool)context.Variable["allow-proof-of-possession-tokens"])" />
403-
</inbound>
404-
</policies>
405-
""",
406-
DisplayName =
407-
"Should compile validate-azure-ad-token policy with expression in allow-proof-of-possession-tokens"
408-
)]
409-
[DataRow(
410-
"""
411-
[Document]
412-
public class PolicyDocument : IDocument
413-
{
414-
public void Inbound(IInboundContext context) {
415-
context.ValidateAzureAdToken(new ValidateAzureAdTokenConfig
416-
{
417-
TenantId = "{{aad-tenant-id}}",
418-
OutputPftTokenVariableName = "variable-name"
419-
});
420-
}
421-
}
422-
""",
423-
"""
424-
<policies>
425-
<inbound>
426-
<validate-azure-ad-token tenant-id="{{aad-tenant-id}}" output-pft-token-variable-name="variable-name" />
427-
</inbound>
428-
</policies>
429-
""",
430-
DisplayName = "Should compile validate-azure-ad-token policy with output-pft-token-variable-name"
431-
)]
432313
[DataRow(
433314
"""
434315
[Document]

0 commit comments

Comments
 (0)