enonic / xp

Enonic XP
https://enonic.com
GNU General Public License v3.0
202 stars 34 forks source link

The type for Context AuthInfo user is to strict #10456

Closed ComLock closed 6 months ago

ComLock commented 6 months ago

I suspect https://github.com/enonic/xp/blob/e40dc34b0074c44be73faa194b9ab441e8fd1d03/modules/lib/lib-context/src/main/resources/lib/xp/context.ts#L21

This is more correct https://github.com/enonic/xp/blob/e40dc34b0074c44be73faa194b9ab441e8fd1d03/modules/lib/lib-context/src/main/resources/lib/xp/context.ts#L34

Than this https://github.com/enonic/xp/blob/e40dc34b0074c44be73faa194b9ab441e8fd1d03/modules/lib/core/index.d.ts#L28

User type, key and disaplyName, modifiedTime, disabled and email, is never present in the Context?

Can someone check the Java, is idProvider optional in Context AuthInfo user?

ComLock commented 6 months ago

I can try it out in src/main/resources/main.js

ComLock commented 6 months ago

It seems to be a bit magical when it comes to user, at least in main.js

Screenshot 2024-03-13 at 11 03 39 Screenshot 2024-03-13 at 11 03 56

ComLock commented 6 months ago

My impression now is that the types are correct. When implementing a test/mock it should be connected to some concept of user.