Giter Club home page Giter Club logo

Comments (4)

RoystonS avatar RoystonS commented on May 29, 2024

I've switched to the very latest SimpleIdServer source to help diagnose this. I can see that the NullReference exception is actually coming from the first line of ComputeValueIndex: the value of SchemaAttribute is actually null in my case for the attribute with a full path of 'phoneNumbers'. Looking in the database, the SCIMRepresentationAttribute has a null SchemaAttributeId column value.

(Does it ever make sense for that to be null?)

from simpleidserver.

simpleidserver avatar simpleidserver commented on May 29, 2024

Hello,

The SchemaAttributeId is getting erased because the navigation properties are not considered in the BulkInsertAsync instruction :(. The issue has been resolved in the master branch. Could you please try again?

Kind Regards,

SID

from simpleidserver.

RoystonS avatar RoystonS commented on May 29, 2024

Yes, that looks much happier. The SchemaAttributeId is no longer getting into the database as null, and the ComputedValueIndex (whatever that is) is also being populated now, so reads work happily.

Thank you for the rapid fix!

If SchemaAttributeId is always a required value, would it be worth tweaking the definition of it so that nulls can't get into the database?
e.g.

public void Configure(EntityTypeBuilder<SCIMRepresentationAttribute> builder)
{
    ...
    builder.Property(a => a.SchemaAttributeId).IsRequired();
    ...
}

?


Btw, I'm currently attempting to add multi-tenant support for SCIM. I've seen the existing 'shadow property' example, but it requires copying quite a bit of CommandRepository/QueryRepository code. I've just about managed to make a set of code work that only:

  1. subclasses the ScimDbContext (to filter on tenant and add tenant during writes)
  2. subclasses RepresentationHelper so that I can make the attributes marked as SCIMSchemaAttributeUniqueness.SERVER and SCIMSchemaAttributeUniqueness.GLOBAL have slightly different behaviour (i.e. per-instance and global, respectively)

i.e. I've not had to make any changes to, or any copies of, any of the repositories, which is really nice.

Doing this would be a little easier if there was an extra protected constructor on ScimDbContext to allow easy subclassing, and if RepresentationHelper.CheckUniqueness were marked virtual. Would you be willing to accept small PRs along those lines?

from simpleidserver.

simpleidserver avatar simpleidserver commented on May 29, 2024

Hello,

Certainly, the SchemaAttributeId can be designated as a required property in the Entity Framework Configuration.

I would appreciate it if you could submit a pull request with your suggested modifications to simplify the ScimShadowProperty sample project :)

from simpleidserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.