kamax-matrix / mxisd

Federated Matrix Identity Server
GNU Affero General Public License v3.0
220 stars 112 forks source link

Session configuration causes exception #113

Closed mdickopp closed 5 years ago

mdickopp commented 5 years ago

I have the following in my configuration file:

session:
  policy:
    validation:
      enabled: true
      forLocal:
        enabled: true
        toLocal: true
        toRemote:
          enabled: false
      forRemote:
        enabled: true
        toLocal: true
        toRemote:
          enabled: false

This works fine with v1.2.2, but causes an exception with v1.3.0-alpha.2:

Jan 27 14:20:46 chat-test mxisd[29217]: Exception in thread "main" Cannot create property=session for JavaBean=io.kamax.mxisd.config.MxisdConfig@7ca48474
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 1, column 1:
Jan 27 14:20:46 chat-test mxisd[29217]:     matrix:
Jan 27 14:20:46 chat-test mxisd[29217]:     ^
Jan 27 14:20:46 chat-test mxisd[29217]: Cannot create property=policy for JavaBean=io.kamax.mxisd.config.SessionConfig@13a57a3b
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 42, column 3:
Jan 27 14:20:46 chat-test mxisd[29217]:       policy:
Jan 27 14:20:46 chat-test mxisd[29217]:       ^
Jan 27 14:20:46 chat-test mxisd[29217]: Cannot create property=validation for JavaBean=io.kamax.mxisd.config.SessionConfig$Policy@69d9c55
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 43, column 5:
Jan 27 14:20:46 chat-test mxisd[29217]:         validation:
Jan 27 14:20:46 chat-test mxisd[29217]:         ^
Jan 27 14:20:46 chat-test mxisd[29217]: Cannot create property=forLocal for JavaBean=io.kamax.mxisd.config.SessionConfig$Policy$PolicyTemplate@7f560810
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 44, column 7:
Jan 27 14:20:46 chat-test mxisd[29217]:           enabled: true
Jan 27 14:20:46 chat-test mxisd[29217]:           ^
Jan 27 14:20:46 chat-test mxisd[29217]: No writable property 'forLocal' on class: io.kamax.mxisd.config.SessionConfig$Policy$PolicyTemplate
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 46, column 9:
Jan 27 14:20:46 chat-test mxisd[29217]:             enabled: true
Jan 27 14:20:46 chat-test mxisd[29217]:             ^
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 44, column 7:
Jan 27 14:20:46 chat-test mxisd[29217]:           enabled: true
Jan 27 14:20:46 chat-test mxisd[29217]:           ^
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 43, column 5:
Jan 27 14:20:46 chat-test mxisd[29217]:         validation:
Jan 27 14:20:46 chat-test mxisd[29217]:         ^
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 42, column 3:
Jan 27 14:20:46 chat-test mxisd[29217]:       policy:
Jan 27 14:20:46 chat-test mxisd[29217]:       ^
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:270)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:149)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:309)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:204)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:193)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:159)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:146)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:524)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.Yaml.load(Yaml.java:452)
Jan 27 14:20:46 chat-test mxisd[29217]:         at io.kamax.mxisd.config.YamlConfigLoader.loadFromFile(YamlConfigLoader.java:41)
Jan 27 14:20:46 chat-test mxisd[29217]:         at io.kamax.mxisd.config.YamlConfigLoader.tryLoadFromFile(YamlConfigLoader.java:48)
Jan 27 14:20:46 chat-test mxisd[29217]:         at io.kamax.mxisd.MxisdStandaloneExec.main(MxisdStandaloneExec.java:51)
Jan 27 14:20:46 chat-test mxisd[29217]: Caused by: Cannot create property=policy for JavaBean=io.kamax.mxisd.config.SessionConfig@13a57a3b
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 42, column 3:
Jan 27 14:20:46 chat-test mxisd[29217]:       policy:
Jan 27 14:20:46 chat-test mxisd[29217]:       ^
Jan 27 14:20:46 chat-test mxisd[29217]: Cannot create property=validation for JavaBean=io.kamax.mxisd.config.SessionConfig$Policy@69d9c55
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 43, column 5:
Jan 27 14:20:46 chat-test mxisd[29217]:         validation:
Jan 27 14:20:46 chat-test mxisd[29217]:         ^
Jan 27 14:20:46 chat-test mxisd[29217]: Cannot create property=forLocal for JavaBean=io.kamax.mxisd.config.SessionConfig$Policy$PolicyTemplate@7f560810
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 44, column 7:
Jan 27 14:20:46 chat-test mxisd[29217]:           enabled: true
Jan 27 14:20:46 chat-test mxisd[29217]:           ^
Jan 27 14:20:46 chat-test mxisd[29217]: No writable property 'forLocal' on class: io.kamax.mxisd.config.SessionConfig$Policy$PolicyTemplate
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 46, column 9:
Jan 27 14:20:46 chat-test mxisd[29217]:             enabled: true
Jan 27 14:20:46 chat-test mxisd[29217]:             ^
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 44, column 7:
Jan 27 14:20:46 chat-test mxisd[29217]:           enabled: true
Jan 27 14:20:46 chat-test mxisd[29217]:           ^
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 43, column 5:
Jan 27 14:20:46 chat-test mxisd[29217]:         validation:
Jan 27 14:20:46 chat-test mxisd[29217]:         ^
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:270)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:149)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:204)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:193)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.newInstance(Constructor.java:283)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:246)
Jan 27 14:20:46 chat-test mxisd[29217]:         ... 11 more
Jan 27 14:20:46 chat-test mxisd[29217]: Caused by: Cannot create property=validation for JavaBean=io.kamax.mxisd.config.SessionConfig$Policy@69d9c55
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 43, column 5:
Jan 27 14:20:46 chat-test mxisd[29217]:         validation:
Jan 27 14:20:46 chat-test mxisd[29217]:         ^
Jan 27 14:20:46 chat-test mxisd[29217]: Cannot create property=forLocal for JavaBean=io.kamax.mxisd.config.SessionConfig$Policy$PolicyTemplate@7f560810
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 44, column 7:
Jan 27 14:20:46 chat-test mxisd[29217]:           enabled: true
Jan 27 14:20:46 chat-test mxisd[29217]:           ^
Jan 27 14:20:46 chat-test mxisd[29217]: No writable property 'forLocal' on class: io.kamax.mxisd.config.SessionConfig$Policy$PolicyTemplate
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 46, column 9:
Jan 27 14:20:46 chat-test mxisd[29217]:             enabled: true
Jan 27 14:20:46 chat-test mxisd[29217]:             ^
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 44, column 7:
Jan 27 14:20:46 chat-test mxisd[29217]:           enabled: true
Jan 27 14:20:46 chat-test mxisd[29217]:           ^
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:270)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:149)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:204)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:193)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:247)
Jan 27 14:20:46 chat-test mxisd[29217]:         ... 16 more
Jan 27 14:20:46 chat-test mxisd[29217]: Caused by: Cannot create property=forLocal for JavaBean=io.kamax.mxisd.config.SessionConfig$Policy$PolicyTemplate@7f560810
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 44, column 7:
Jan 27 14:20:46 chat-test mxisd[29217]:           enabled: true
Jan 27 14:20:46 chat-test mxisd[29217]:           ^
Jan 27 14:20:46 chat-test mxisd[29217]: No writable property 'forLocal' on class: io.kamax.mxisd.config.SessionConfig$Policy$PolicyTemplate
Jan 27 14:20:46 chat-test mxisd[29217]:  in 'reader', line 46, column 9:
Jan 27 14:20:46 chat-test mxisd[29217]:             enabled: true
Jan 27 14:20:46 chat-test mxisd[29217]:             ^
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:270)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:149)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:204)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:193)
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:247)
Jan 27 14:20:46 chat-test mxisd[29217]:         ... 20 more
Jan 27 14:20:46 chat-test mxisd[29217]: Caused by: org.yaml.snakeyaml.error.YAMLException: No writable property 'forLocal' on class: io.kamax.mxisd.config.SessionConfig$Policy$PolicyTemplate
Jan 27 14:20:46 chat-test mxisd[29217]:         at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:213)
Jan 27 14:20:46 chat-test mxisd[29217]:         ... 24 more
maxidorius commented 5 years ago

From the stack trace, it seems like you got the indentation/layout wrong in other parts of your configuration, and adding this bit makes it fail. If you're unsure, you can always send me the complete unedited file (except for passwords) in a DM on Matrix or via email using the address on my profile.

maxidorius commented 5 years ago

@mdickopp any update? else I'll close this issue following inactivity.

mdickopp commented 5 years ago

Here is the complete file that fails for me with v1.3.0-alpha.2 (and v1.3.0-alpha.3):

mxisd.yaml

The only changes I made is that I replaced the real domain name with example.com and the database password with x characters.

maxidorius commented 5 years ago

Ok, I think the issue was fixed as part of v1.3.0-rc.2. Could you please adapt the configuration for it for the session and view sections and then try again?

The new session format is described here and the new view format is described at Step 3 here.

If you're still hitting the issue, please post your config file once again.

maxidorius commented 5 years ago

@mdickopp I've fixed a few other bugs meanwhile. Could you let me know how you install mxisd and I'll provide you with the latest build.

maxidorius commented 5 years ago

Closed due to inactivity. Please test with latest RC or the full release if that's already available and re-open the issue if you still have the problem.