This repository was archived by the owner on Feb 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +50
-4
lines changed
Gatekeeper.SCIM.Client.Tests.Integration Expand file tree Collapse file tree 7 files changed +50
-4
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
33using System . Linq ;
4- using System . Text . Json ;
54using System . Threading . Tasks ;
65using Gatekeeper . SCIM . Client . Action ;
76using Gatekeeper . SCIM . Client . Result ;
@@ -40,6 +39,7 @@ public async Task IntegrationTest()
4039 } ;
4140 CreateAction < User > createUserAction = new CreateAction < User > ( user ) ;
4241 CreateResult < User > createUserResult = await client . PerformAction < CreateResult < User > > ( createUserAction ) ;
42+
4343 Assert . Equal ( StateEnum . Success , createUserResult . ResultStatus ) ;
4444 user . AsSource ( )
4545 . OfLikeness < User > ( )
Original file line number Diff line number Diff line change @@ -49,9 +49,13 @@ public void SetAuthToken(string authToken)
4949 }
5050 else
5151 {
52+ ErrorResult errorResult = await response . Content . ReadFromJsonAsync < ErrorResult > ( ) ;
53+
5254 return ( TResult ) ( object ) new CreateResult < User >
5355 {
5456 ResultStatus = StateEnum . Failure ,
57+ ErrorDetail = ( errorResult . Detail != null ) ? errorResult . Detail : null ,
58+ ScimType = ( errorResult . ScimType != null ) ? errorResult . ScimType : null ,
5559 } ;
5660 }
5761
Original file line number Diff line number Diff line change 66 <IncludeSymbols >true</IncludeSymbols >
77 <SymbolPackageFormat >snupkg</SymbolPackageFormat >
88
9- <Version >0.0.2 -alpha</Version >
9+ <Version >0.0.3 -alpha</Version >
1010 <Authors >Lukas Reschke</Authors >
1111 <Company >Gatekeeper</Company >
1212 <Description >
1818 <PackageProjectUrl >https://github.com/GetGatekeeper/SCIM.Client</PackageProjectUrl >
1919 <RepositoryUrl >https://github.com/GetGatekeeper/SCIM.Client.git</RepositoryUrl >
2020 <PackageReleaseNotes >
21- Add support for email attribute .
21+ Parse Errors .
2222 </PackageReleaseNotes >
2323 <RepositoryType >git</RepositoryType >
2424 <Title >Gatekeeper.SCIM.Client</Title >
Original file line number Diff line number Diff line change 22
33namespace Gatekeeper . SCIM . Client . Result
44{
5- public class CreateResult < T > : IResult where T : IResource
5+ public class CreateResult < T > : IResult , IError where T : IResource
66 {
77 public StateEnum ResultStatus { get ; set ; }
88 public T ? Resource { get ; set ; }
9+ public string ? ErrorDetail { get ; set ; }
10+ public ErrorResult . ScimTypeEnum ? ScimType { get ; set ; }
911 }
1012}
Original file line number Diff line number Diff line change 1+ using System . Text . Json . Serialization ;
2+
3+ namespace Gatekeeper . SCIM . Client . Result
4+ {
5+ public class ErrorResult
6+ {
7+ [ JsonPropertyName ( "detail" ) ]
8+ public string ? Detail { get ; set ; }
9+
10+ [ JsonPropertyName ( "scimType" ) ]
11+ public ScimTypeEnum ? ScimType { get ; set ; }
12+
13+ public enum ScimTypeEnum
14+ {
15+ invalidFilter = 1 ,
16+ tooMany = 2 ,
17+ uniqueness = 3 ,
18+ mutability = 4 ,
19+ invalidSyntax = 5 ,
20+ invalidPath = 6 ,
21+ noTarget = 7 ,
22+ invalidValue = 8 ,
23+ invalidVers = 9 ,
24+ sensitive = 10 ,
25+ }
26+ }
27+ }
Original file line number Diff line number Diff line change 1+ using static Gatekeeper . SCIM . Client . Result . ErrorResult ;
2+
3+ namespace Gatekeeper . SCIM . Client . Result
4+ {
5+ interface IError
6+ {
7+ public string ? ErrorDetail { get ; set ; }
8+ public ScimTypeEnum ? ScimType { get ; set ; }
9+ }
10+ }
Original file line number Diff line number Diff line change @@ -62,6 +62,9 @@ public class EmailAttribute
6262 {
6363 [ JsonPropertyName ( "value" ) ]
6464 public string ? Value { get ; set ; }
65+
66+ [ JsonPropertyName ( "primary" ) ]
67+ public bool Primary { get ; set ; }
6568 }
6669
6770 public class GroupMembership
You can’t perform that action at this time.
0 commit comments