Skip to content

Commit a6a0a37

Browse files
authored
chore: Change namespace to Azure.ApiManagement.PolicyToolkit.* (#4)
Signed-off-by: Tom Kerkhove <[email protected]>
1 parent d2a76f5 commit a6a0a37

File tree

214 files changed

+383
-389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+383
-389
lines changed

.github/workflows/dotnet.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# This workflow will build a .NET project
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3-
4-
name: .NET
1+
name: CI
52

63
on:
74
push:
@@ -11,9 +8,7 @@ on:
118

129
jobs:
1310
build:
14-
1511
runs-on: ubuntu-latest
16-
1712
steps:
1813
- uses: actions/checkout@v3
1914
- name: Setup .NET

docs/QuickStart.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ We will cover the following topics:
2525
```
2626
* Add Azure API Management policy toolkit library by running
2727
```shell
28-
dotnet add package Mielek.Azure.ApiManagement.PolicyToolkit.Authoring
28+
dotnet add package Azure.ApiManagement.PolicyToolkit.Authoring
2929
```
3030

3131
| :exclamation: Azure API Management Policy toolkit is not yet published to nuget. For now, please follow the repository setup guide to obtain packages mentioned in the document. |
@@ -48,10 +48,10 @@ dotnet new class -n ApiOperationPolicy
4848
```
4949
5050
The class in the file should inherit from `IDocument` interface and have `Document` attribute
51-
from `Mielek.Azure.ApiManagement.PolicyToolkit.Authoring` namespace.
51+
from `Azure.ApiManagement.PolicyToolkit.Authoring` namespace.
5252
5353
```csharp
54-
using Mielek.Azure.ApiManagement.PolicyToolkit.Authoring;
54+
using Azure.ApiManagement.PolicyToolkit.Authoring;
5555
5656
namespace Contoso.Apis.Policies;
5757
@@ -104,7 +104,7 @@ solution folder.
104104

105105
```shell
106106
cd .. # Go to solution folder if not already there
107-
dotnet tool install Mielek.Azure.ApiManagement.PolicyToolkit.Compiler
107+
dotnet tool install Azure.ApiManagement.PolicyToolkit.Compiler
108108
````
109109
110110
After the installation, the compiler should be available in the project folder.
@@ -155,8 +155,8 @@ If request comes from other IP addresses it should use `Bearer` token received f
155155
For every request we want to add header with the user id.
156156
157157
```csharp
158-
using Mielek.Azure.ApiManagement.PolicyToolkit.Authoring;
159-
using Mielek.Azure.ApiManagement.PolicyToolkit.Authoring.Expressions;
158+
using Azure.ApiManagement.PolicyToolkit.Authoring;
159+
using Azure.ApiManagement.PolicyToolkit.Authoring.Expressions;
160160
161161
namespace Contoso.Apis.Policies;
162162
@@ -195,7 +195,7 @@ Let's unpack the code above it:
195195
expression
196196
* Every method, other than section method are treated as expressions. They need to accept one parameter of type
197197
`IExpressionContext`
198-
with name `context`. Type is available in `Mielek.Azure.ApiManagement.PolicyToolkit.Authoring.Expressions` namespace.
198+
with name `context`. Type is available in `Azure.ApiManagement.PolicyToolkit.Authoring.Expressions` namespace.
199199
* `IExpressionContext` type contains the same properties as `context` object in policy expressions.
200200
* `AuthenticationBasic` method is mapped to `authentication-basic` policy.
201201
* `AuthenticationManagedIdentity` method is mapped to `authentication-managed-identity` policy.
@@ -254,7 +254,7 @@ the following commands.
254254
```shell
255255
dotnet new mstest --output Contoso.Apis.Policies.Tests
256256
cd Contoso.Apis.Policies.Tests
257-
dotnet add package Mielek.Azure.ApiManagement.PolicyToolkit.Testing
257+
dotnet add package Azure.ApiManagement.PolicyToolkit.Testing
258258
dotnet add reference ..\Contoso.Apis.Policies
259259
dotnet new class -n ApiOperationPolicyTest
260260
```
@@ -264,7 +264,7 @@ Perfect! Now we can write a test for `IsCompanyIP` method in the class.
264264
```csharp
265265
using Contoso.Apis.Policies;
266266
267-
using Mielek.Azure.ApiManagement.PolicyToolkit.Emulator.Expressions;
267+
using Azure.ApiManagement.PolicyToolkit.Emulator.Expressions;
268268
269269
using Microsoft.VisualStudio.TestTools.UnitTesting;
270270
using Newtonsoft.Json.Linq;
@@ -293,7 +293,7 @@ Let's unpack the code above:
293293
* Test class is a standard MSTest class with one test method. You can use your favorite testing framework in place of MS
294294
test. Policy framework is not dependent on any testing framework.
295295
* `MockExpressionContext` is a class which is used to mock request context. It is available in
296-
`Mielek.Azure.ApiManagement.PolicyToolkit.Emulator.Expressions` namespace. It implements `IExpressionContext`
296+
`Azure.ApiManagement.PolicyToolkit.Emulator.Expressions` namespace. It implements `IExpressionContext`
297297
interface and expose a helper properties to set up request context.
298298
* `context.MockRequest.IpAddress = "10.0.0.12"` is setting a IpAddress for request.
299299

example/.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"version": 1,
33
"isRoot": true,
44
"tools": {
5-
"mielek.azure.apimanagement.policytoolkit.compiler": {
5+
"Azure.ApiManagement.policytoolkit.compiler": {
66
"version": "0.0.1",
77
"commands": [
88
"policy-compiler"

example/source/ApiOperationPolicy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Mielek.Azure.ApiManagement.PolicyToolkit.Authoring;
2-
using Mielek.Azure.ApiManagement.PolicyToolkit.Authoring.Expressions;
1+
using Azure.ApiManagement.PolicyToolkit.Authoring;
2+
using Azure.ApiManagement.PolicyToolkit.Authoring.Expressions;
33

44
using Newtonsoft.Json.Linq;
55

example/source/RequestOAuth2FromSAPUsingAAD.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.Text;
22

3-
using Mielek.Azure.ApiManagement.PolicyToolkit.Authoring;
4-
using Mielek.Azure.ApiManagement.PolicyToolkit.Authoring.Expressions;
3+
using Azure.ApiManagement.PolicyToolkit.Authoring;
4+
using Azure.ApiManagement.PolicyToolkit.Authoring.Expressions;
55

66
using Newtonsoft.Json.Linq;
77

example/source/Source.Example.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Mielek.Azure.ApiManagement.PolicyToolkit" Version="0.0.1" />
14+
<PackageReference Include="Azure.ApiManagement.PolicyToolkit" Version="0.0.1" />
1515
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
1616
</ItemGroup>
1717
</Project>

example/test/ApiOperationPolicyTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Contoso.Apis;
22

3-
using Mielek.Azure.ApiManagement.PolicyToolkit.Emulator.Expressions;
3+
using Azure.ApiManagement.PolicyToolkit.Emulator.Expressions;
44

55
using Newtonsoft.Json.Linq;
66

example/test/Test.Example.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</ItemGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="Mielek.Azure.ApiManagement.PolicyToolkit.Testing" Version="0.0.1" />
25+
<PackageReference Include="Azure.ApiManagement.PolicyToolkit.Testing" Version="0.0.1" />
2626
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
2727
</ItemGroup>
2828

src/Analyzers/ExpressionDefinition.Analyzer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using Microsoft.CodeAnalysis.CSharp.Syntax;
66
using Microsoft.CodeAnalysis.Diagnostics;
77

8-
namespace Mielek.Azure.ApiManagement.PolicyToolkit.Analyzers;
8+
namespace Azure.ApiManagement.PolicyToolkit.Analyzers;
99

1010
[DiagnosticAnalyzer(LanguageNames.CSharp)]
1111
public class ExpressionDefinitionAnalyzer : DiagnosticAnalyzer
@@ -44,7 +44,7 @@ public override void Initialize(AnalysisContext context)
4444
"Newtonsoft.Json.Linq.JObject",
4545
};
4646

47-
private const string ContextParamType = "Mielek.Azure.ApiManagement.PolicyToolkit.Authoring.Expressions.IExpressionContext";
47+
private const string ContextParamType = "Azure.ApiManagement.PolicyToolkit.Authoring.Expressions.IExpressionContext";
4848
private const string ContextParamName = "context";
4949

5050
private static void AnalyzeMethod(SyntaxNodeAnalysisContext context)

src/Analyzers/ExpressionDefinition.Rules.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
using Microsoft.CodeAnalysis;
44

5-
namespace Mielek.Azure.ApiManagement.PolicyToolkit.Analyzers;
5+
namespace Azure.ApiManagement.PolicyToolkit.Analyzers;
66

77
public static partial class Rules
88
{

0 commit comments

Comments
 (0)