Skip to content

Accept nil values for attribiutes defined as required and read-only.#161

Merged
q-uint merged 1 commit intoelimity-com:masterfrom
pendo-io:required-readonly
Mar 24, 2026
Merged

Accept nil values for attribiutes defined as required and read-only.#161
q-uint merged 1 commit intoelimity-com:masterfrom
pendo-io:required-readonly

Conversation

@mibanescu
Copy link
Contributor

This is particularly relevant for the id attribute, which is typically defined as required and read-only. It is assigned by the IdP, and required to be returned. It should not be required to be specified on POST/PUT/PATCH.

This is particularly relevant for the id attribute, which is typically
defined as required and read-only. It is assigned by the IdP, and
required to be returned. It should not be required to be specified
on POST/PUT/PATCH.
Copy link
Collaborator

@q-uint q-uint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This aligns with the RFC:

  • RFC 7643 Section 3.1: id is required and readOnly, meaning the service provider assigns it, not the client.
  • RFC 7644 Section 3.3: attributes with mutability: readOnly "SHALL be ignored" by the server in POST/PUT requests.
    A required + readOnly attribute is required in the response (server must populate it), not in the request. The current code rejects the request before it ever reaches the readOnly check. This fix correctly reorders that logic.

No concern about weakening outgoing validation either: Schema.Validate is only called on incoming POST/PUT requests (see comment in schema.go).

@q-uint q-uint merged commit 1c45186 into elimity-com:master Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants