forked from Azure/PSRule.Rules.Azure
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed handling of multi-line descriptions Azure#2973 (Azure#2975)
- Loading branch information
1 parent
6091771
commit 7788c3e
Showing
16 changed files
with
430 additions
and
211 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace PSRule.Rules.Azure.Data.Policy | ||
{ | ||
internal interface ILazyValue | ||
{ | ||
object GetValue(PolicyAssignmentVisitor.PolicyAssignmentContext context); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace PSRule.Rules.Azure.Data.Policy | ||
{ | ||
internal interface IParameterValue | ||
{ | ||
string Name { get; } | ||
|
||
ParameterType Type { get; } | ||
|
||
object GetValue(PolicyAssignmentVisitor.PolicyAssignmentContext context); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using Newtonsoft.Json.Linq; | ||
using PSRule.Rules.Azure.Data.Template; | ||
|
||
namespace PSRule.Rules.Azure.Data.Policy | ||
{ | ||
internal sealed class LazyParameter<T> : ILazyValue, IParameterValue | ||
{ | ||
private readonly JToken _LazyValue; | ||
private T _Value; | ||
private bool _Resolved; | ||
|
||
public LazyParameter(string name, ParameterType type, JToken defaultValue) | ||
{ | ||
Name = name; | ||
Type = type; | ||
_LazyValue = defaultValue; | ||
} | ||
|
||
public string Name { get; } | ||
|
||
public ParameterType Type { get; } | ||
|
||
public object GetValue(PolicyAssignmentVisitor.PolicyAssignmentContext context) | ||
{ | ||
if (!_Resolved) | ||
{ | ||
_Value = TemplateVisitor.ExpandToken<T>(context, _LazyValue); | ||
_Resolved = true; | ||
} | ||
return _Value; | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
|
||
namespace PSRule.Rules.Azure.Data.Policy | ||
{ | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
internal enum ParameterType | ||
{ | ||
String, | ||
|
||
Array, | ||
|
||
Object, | ||
|
||
Boolean, | ||
|
||
Integer, | ||
|
||
Float, | ||
|
||
DateTime | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/PSRule.Rules.Azure/Data/Policy/PolicyAssignmentDataExportVisitor.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace PSRule.Rules.Azure.Data.Policy | ||
{ | ||
internal sealed class PolicyAssignmentDataExportVisitor : PolicyAssignmentVisitor | ||
{ | ||
|
||
} | ||
} |
This file contains 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
Oops, something went wrong.