You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "erant10 (via GitHub)" <gi...@apache.org> on 2023/12/14 19:21:14 UTC

[I] Enriching calls to scim repository [directory-scimple]

erant10 opened a new issue, #449:
URL: https://github.com/apache/directory-scimple/issues/449

   Trying to figure out a way to “enrich” calls coming into the scim repositories with additional context which is not part of the ScimResource (e.g. customerId, directory provider - azure/okta/other, environment, etc...). 
   
   This data usually comes in scim requests the form of http headers or jwt token claims, and we need it to persist it into the db.
   
   My first thought was to add this information as a custom extension but this means manipulating the scim resource which is better to avoid…
   
   Alternatively we can extract this information in the base resource impl class and change the repositories a bit, but wanted to start a discussion thread on in case someone has a more elegant idea that doesn’t involve a big refactor.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org


Re: [I] Enriching calls to scim repository [directory-scimple]

Posted by "erant10 (via GitHub)" <gi...@apache.org>.
erant10 commented on issue #449:
URL: https://github.com/apache/directory-scimple/issues/449#issuecomment-1957329012

   No it was about Guice binding the ScimResourceContextProvider with its `Http` implementation... I tried doing that using some internal jaxrs binding module we have but that didn't work so I had to bind it explicitly 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org


Re: [I] Enriching calls to scim repository [directory-scimple]

Posted by "erant10 (via GitHub)" <gi...@apache.org>.
erant10 commented on issue #449:
URL: https://github.com/apache/directory-scimple/issues/449#issuecomment-1957303239

   @bdemers Sorry totally forgot to respond. Basically did exactly what you said - the abstraction ScimResourceContext injected with RequestContext which has everything I need. Had some annoying injection issues but eventually worked perfectly. Thank you!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org


Re: [I] Enriching calls to scim repository [directory-scimple]

Posted by "erant10 (via GitHub)" <gi...@apache.org>.
erant10 closed issue #449: Enriching calls to scim repository
URL: https://github.com/apache/directory-scimple/issues/449


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org


Re: [I] Enriching calls to scim repository [directory-scimple]

Posted by "bdemers (via GitHub)" <gi...@apache.org>.
bdemers commented on issue #449:
URL: https://github.com/apache/directory-scimple/issues/449#issuecomment-1856839560

   I think you could add a layer of abstraction, 
   e.g. create a component with an interface `ScimResourceContext` (🤢 naming is hard)
   with a bunch of getters for the attributes you need.
   Create an impl that maps the web bits to those getters 🤔 
   
   Something like that anyway, I'm guessing something like this would be useful for a wider audience (auditing, logging, etc)
   If you end up worth pushing back into SCIMple please do!
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org


Re: [I] Enriching calls to scim repository [directory-scimple]

Posted by "bdemers (via GitHub)" <gi...@apache.org>.
bdemers commented on issue #449:
URL: https://github.com/apache/directory-scimple/issues/449#issuecomment-1957313052

   Thanks for the update!
   As an aside, where your annoying injection issues related to field injection of the RequestContext and/or the mixing and matching of JAX-RS context with CDI beans?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org


Re: [I] Enriching calls to scim repository [directory-scimple]

Posted by "bdemers (via GitHub)" <gi...@apache.org>.
bdemers commented on issue #449:
URL: https://github.com/apache/directory-scimple/issues/449#issuecomment-1874222458

   @erant10 What did you end up doing?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org


Re: [I] Enriching calls to scim repository [directory-scimple]

Posted by "bdemers (via GitHub)" <gi...@apache.org>.
bdemers commented on issue #449:
URL: https://github.com/apache/directory-scimple/issues/449#issuecomment-1856484338

   🤔 You could probably inject the SecurityContext and HTTP request objects into your `Repository` implementation
   
   NOTE: How it gets injected may depend on your container, Jakarta RESTful Web Services 4.0, [will improve this](https://jakarta.ee/specifications/restful-ws/4.0/), but field injection _should_ work everywhere ☹️ 
   
   https://github.com/apache/directory-scimple/blob/develop/scim-server/src/main/java/org/apache/directory/scim/server/rest/SelfResourceImpl.java#L51-L52
   
   https://github.com/apache/directory-scimple/blob/develop/scim-server/src/main/java/org/apache/directory/scim/server/rest/BaseResourceTypeResourceImpl.java#L78-L85
   
   If that doesn't work, let us know!
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org


Re: [I] Enriching calls to scim repository [directory-scimple]

Posted by "erant10 (via GitHub)" <gi...@apache.org>.
erant10 commented on issue #449:
URL: https://github.com/apache/directory-scimple/issues/449#issuecomment-1856498607

   Interesting. I guess was wary making the Repository aware of the http layer, but maybe its unavoidable in this case.. i will definitely give that a shot
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@directory.apache.org
For additional commands, e-mail: dev-help@directory.apache.org