ether / ep_openid_connect

Etherpad plugin to authenticate users against an OpenID Connect provider
Other
5 stars 8 forks source link

default property should not be force to string #100

Open pengu-fr opened 1 year ago

pengu-fr commented 1 year ago

We can not use the "default" property for is_admin, readOnly or canCreate, because the "default" property is forced to be of type string.

Config :

"ep_openid_connect": {
  "issuer": "https://idp.xxxx.xx/auth/realms/xxxxxx",
  "client_id": "etherpad",
  "client_secret": "*****************",
  "base_url": "https://***.*******.**",
  "scope": ["openid"],
  "user_properties": {
    "displayname": {"claim": "name"},
    "is_admin": {
      "claim": "etherpad_is_admin",
      "default": false
    },
    "readOnly": {"default": false},
    "canCreate": {"default": true}
  }
}

In the logs :

[2023-01-25 14:04:49.581] [ERROR] plugin:ep_openid_connect - Invalid settings. Detailed validation errors: [
  {
    instancePath: '/user_properties/is_admin/default',
    schemaPath: '/optionalProperties/user_properties/values/optionalProperties/default/type',
    keyword: 'type',
    params: { type: 'string', nullable: false },
    message: 'must be string'
  }
]