Skip to content
This repository was archived by the owner on Jun 26, 2025. It is now read-only.

Commit 45f30dd

Browse files
authored
Merge pull request #27 from OctopusDeploy/enh-mediatorcontracts
Moving message contracts out of server
2 parents fd82b15 + 524ca44 commit 45f30dd

34 files changed

+2
-843
lines changed

source/Octopus.Data/Model/Href.cs

Lines changed: 0 additions & 62 deletions
This file was deleted.

source/Octopus.Data/Model/LinkCollection.cs

Lines changed: 0 additions & 24 deletions
This file was deleted.

source/Octopus.Data/Model/LinkCollectionExtensions.cs

Lines changed: 0 additions & 28 deletions
This file was deleted.

source/Octopus.Data/Model/ReferenceCollection.cs

Lines changed: 0 additions & 64 deletions
This file was deleted.

source/Octopus.Data/Model/User/Identity.cs

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using Newtonsoft.Json;
5-
using Octopus.Data.Resources.Users;
65

76
namespace Octopus.Data.Model.User
87
{
9-
public sealed class Identity : IEquatable<Identity>, IEquatable<IdentityResource>
8+
public sealed class Identity : IEquatable<Identity>
109
{
1110
public Identity(string identityProviderName)
1211
{
@@ -45,60 +44,6 @@ public bool Equals(Identity other)
4544
});
4645
}
4746

48-
public bool Equals(IdentityResource other)
49-
{
50-
if (ReferenceEquals(null, other)) return false;
51-
if (IdentityProviderName != other.IdentityProviderName) return false;
52-
return Claims.All(kvp =>
53-
{
54-
if (!kvp.Value.IsIdentifyingClaim || kvp.Value.IsServerSideOnly)
55-
return true;
56-
if (!other.Claims.ContainsKey(kvp.Key))
57-
return false;
58-
var existingClaimValue = kvp.Value.Value;
59-
var bothClaimsAreNullOrWhitespace = string.IsNullOrWhiteSpace(existingClaimValue) &&
60-
string.IsNullOrWhiteSpace(other.Claims[kvp.Key].Value);
61-
var existingClaimHasValueAndMatches = !string.IsNullOrWhiteSpace(existingClaimValue) &&
62-
existingClaimValue.Equals(other.Claims[kvp.Key].Value,
63-
StringComparison.OrdinalIgnoreCase);
64-
return bothClaimsAreNullOrWhitespace || existingClaimHasValueAndMatches;
65-
});
66-
}
67-
68-
public IdentityResource ToResource()
69-
{
70-
return new IdentityResource(IdentityProviderName)
71-
.WithClaims(Claims);
72-
}
73-
74-
internal Identity WithClaims(Dictionary<string, IdentityClaimResource> claims)
75-
{
76-
foreach (var kvp in claims)
77-
if (Claims.ContainsKey(kvp.Key))
78-
Claims[kvp.Key].Value = kvp.Value.Value;
79-
else
80-
Claims.Add(kvp.Key, new IdentityClaim(kvp.Value.Value, kvp.Value.IsIdentifyingClaim));
81-
return this;
82-
}
83-
84-
public Identity WithClaim(string type, string value, bool isIdentifyingClaim, bool isServerSideOnly = false)
85-
{
86-
if (Claims.ContainsKey(type))
87-
{
88-
var claim = Claims[type];
89-
claim.Value = value;
90-
claim.IsIdentifyingClaim = isIdentifyingClaim;
91-
claim.IsServerSideOnly = isServerSideOnly;
92-
}
93-
else
94-
{
95-
var claim = new IdentityClaim(value, isIdentifyingClaim, isServerSideOnly);
96-
Claims.Add(type, claim);
97-
}
98-
99-
return this;
100-
}
101-
10247
public override bool Equals(object obj)
10348
{
10449
if (ReferenceEquals(null, obj)) return false;

source/Octopus.Data/Octopus.Data.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-
<None Include="icon.png" Pack="true" PackagePath="\"/>
25+
<None Include="icon.png" Pack="true" PackagePath="\" />
2626
</ItemGroup>
2727

2828
</Project>

source/Octopus.Data/Resources/Attributes/AllowConnectivityCheckAttribute.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

source/Octopus.Data/Resources/Attributes/AllowCopyToClipboardAttribute.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

source/Octopus.Data/Resources/Attributes/AllowCsvAttribute.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

source/Octopus.Data/Resources/Attributes/ApiPropertyAttribute.cs

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)