JanssenProject / jans

An open source enterprise digital identity platform for CIAM or workforce... Janssen is a distribution of standards-based, developer friendly, components that are engineered to work together in any cloud. #OAuth #OpenID #FIDO
https://docs.jans.io
Apache License 2.0
473 stars 75 forks source link

fix(jans-config-api): attribute `createdAt` Agama deployments type varitaion between `list` and `get` #5081

Closed moabu closed 1 year ago

moabu commented 1 year ago

When querying the list API for Agama deployments, the attribute createdAt is of type string (e.g. '2023-05-16T09:04:24'), whereas when using the get API, the attribute is of type number (i.e. timestamp). This currently breaks JSON unmarshalling.

jgomer2001 commented 1 year ago

that's weird, I fixed that a couple of weeks ago, will revisit

jgomer2001 commented 1 year ago

I confirmed it's working fine @moabu :

$ curl -i -k -H 'Authorization: Bearer moabu' -G https://acme.co/jans-config-api/api/v1/agama-deployment

{"start":0,"totalEntriesCount":1,"entriesCount":1,"entries":[{"dn":"jansId=0f68e01d-c092-3bc2-9b8c-0159c7ae9bea,ou=deployments,ou=agama,o=jans","id":"0f68e01d-c092-3bc2-9b8c-0159c7ae9bea","createdAt":"2023-05-25T19:11:54","taskActive":false,"finishedAt":"2023-05-25T19:12:06","details":{"flowsError":{"hello_world":null},"projectMetadata":{"projectName":"first_steps","author":"notAgluuer","type":"community","description":"An introduction to Agama world","version":"1.0.0","configs":null}},"baseDn":"jansId=0f68e01d-c092-3bc2-9b8c-0159c7ae9bea,ou=deployments,ou=agama,o=jans"}]}

$ curl -i -k -H 'Authorization: Bearer moabu' -G https://acme.co/jans-config-api/api/v1/agama-deployment/first_steps

{"dn":"jansId=0f68e01d-c092-3bc2-9b8c-0159c7ae9bea,ou=deployments,ou=agama,o=jans","id":"0f68e01d-c092-3bc2-9b8c-0159c7ae9bea","createdAt":"2023-05-25T19:11:54","taskActive":false,"finishedAt":"2023-05-25T19:12:06","details":{"flowsError":{"hello_world":null},"projectMetadata":{"projectName":"first_steps","author":"notAgluuer","type":"community","description":"An introduction to Agama world","version":"1.0.0","configs":null}},"baseDn":"jansId=0f68e01d-c092-3bc2-9b8c-0159c7ae9bea,ou=deployments,ou=agama,o=jans"}

This is a today install of Jans server (online installer). I think you are using old binaries. Actually the /list prefix was removed some time ago, just use /agama-deployment