Closed alexander-durovich-swi closed 1 year ago
Hello,
We made some changes in the master
branch to support this feature.
It will be included in the next pre-release candidate :)
It will be possible to add custom validation on any operations (HTTP GET, HTTP PUT, HTTP DELETE). For example, you can check the parameter 'id' from GET operation like this :
CustomGetRepresentationQueryHandler
and override the class GetRepesentationQueryHandler
:public class CustomGetRepresentationQueryHandler : SimpleIdServer.Scim.Queries.GetRepresentationQueryHandler
{
public CustomGetRepresentationQueryHandler(ISCIMSchemaQueryRepository scimSchemaQueryRepository, ISCIMRepresentationQueryRepository scimRepresentationQueryRepository, ILogger<GetRepresentationQueryHandler> logger) : base(scimSchemaQueryRepository, scimRepresentationQueryRepository, logger)
{
}
public override Task<SCIMRepresentation> Handle(string id, GetSCIMResourceRequest parameter, string resourceType)
{
throw new SCIMSchemaViolatedException("error");
return base.Handle(id, parameter, resourceType);
}
}
GetRepresentationQueryHandler
by your class :services.Remove(services.First(s => s.ImplementationType == typeof(GetRepresentationQueryHandler)));
services.AddTransient<IGetRepresentationQueryHandler, CustomGetRepresentationQueryHandler>();
We will keep you inform when the pre-release candidate will be published.
KR,
SID
Hello,
Ok, thank you very much!
Best Regards, Alex
The release 3.0.5-rc1
is published. It contains the following features : https://github.com/simpleidserver/SimpleIdServer/projects/56
Hello,
Ok, thank you very much!
Best Regards, Alex
Hello,
Now the GET ([HttpGet("{id}")]) and DELETE endpoints cannot return the BadRequest (400) status code. We would like to add some validation for the ID parameter and return BadRequest if the Id format is invalid.
By the speicification, the GET and DELETE methods can return 400 status code: https://datatracker.ietf.org/doc/html/rfc7644#page-67:![image](https://github.com/simpleidserver/SimpleIdServer/assets/101582969/5778d29e-7b11-4bb2-aa75-ded7499a4bba)
Is it possible to add such possibility? (Perhpas it is possible to add processing the SCIMSchemaViolatedException into InternalGet and InternalDelete functions like it is done in the PATCH/UPDATE endpoints: https://github.com/simpleidserver/SimpleIdServer/blob/9500c84b6f072a66785a67a9e3f128c2e8f68a0c/src/Scim/SimpleIdServer.Scim/Api/BaseApiController.cs#L623)