Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Common constraints - identifiers #271

Open
wants to merge 38 commits into
base: main
Choose a base branch
from

Conversation

mlagally
Copy link
Contributor

@mlagally mlagally commented Sep 2, 2022

@mlagally mlagally changed the title WIP: common constraints - identifiers Common constraints - identifiers Sep 5, 2022
@mlagally mlagally mentioned this pull request Sep 7, 2022
Copy link
Member

@benfrancis benfrancis left a comment

Choose a reason for hiding this comment

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

I don't particularly object to this section, but the mutable/immutable stuff is already covered in the TD spec and I'm not convinced that a URN is necessarily better than other URIs, like an HTTP URL with a fully qualified domain name for example.

index.html Outdated
<h2>Identifiers</h2>
<p>
Web resources are identified by uniform resource identifiers (URIs).
The Thing Description defines the field <code>id</code> for that purpose, which is in the format "anyURI".
Copy link
Member

Choose a reason for hiding this comment

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

Reference needed for "anyURI" (or the id member in TD which in turn has a reference for "anyURI")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reference was added.

Comment on lines +1875 to +1877
<span class="rfc2119-assertion" id="common-constraints-identifiers-uuid">
It is RECOMMENDED to use Universally Unique IDentifier (UUID) [[RFC4122]] as common format for identifers.
</span>
Copy link
Member

Choose a reason for hiding this comment

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

I'm pleased to see that this is only a recommendation, however:

  1. A UUID is not a URI. Do you perhaps mean a URN?
  2. Can you explain why a URN is a better globally unique identifier than an HTTP URL with a fully qualified domain name and therefore a URN should be recommended over that?

In WebThings we still use the URL of the Thing Description as its ID, which has many benefits.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The URL is not stable in scenarios where things may transition between different networks. Think of roaming scenarios in fleet management, IP reassignment cases etc.

index.html Outdated
</p>
</section>
<section id="sec-identifiers-mutability">
<h3>Unique Identifiers</h3>
Copy link
Member

@benfrancis benfrancis Sep 7, 2022

Choose a reason for hiding this comment

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

Should this title be "Mutable Identifiers", or "Immutable Identifiers"?

Copy link
Contributor Author

@mlagally mlagally Feb 16, 2023

Choose a reason for hiding this comment

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

Both are valid titles, I combined them.

Comment on lines +1886 to +1903
<p>
Many use cases require that identifiers do not change during the lifecycle of the thing in the application context.
However there are cases, where the IDs must change due to legal or privacy obligations.
IDs should be changed when a device is offboarded and onboarded on a new system (e.g. for change
of ownership).
In these cases, or when a device is moved to a new usage context, identifiers usually must change.
</p>

<p><span class="rfc2119-assertion" id="common-constraints-identifiers-mutable">
In certain use cases where privacy is a factor or legal obligations mandate changing identifiers,
the use of a <em>mutable UUID</em> is RECOMMENDED.</span>
</p>

<p><span class="rfc2119-assertion" id="common-constraints-identifiers-immutable-ids">
If possible and allowed by law, required immutable IDs SHOULD be made available through a
property rather than used as the id for the TD itself.
</span></p>
</section>
Copy link
Member

Choose a reason for hiding this comment

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

This is already covered in section 11.2 Immutable Identifiers of TD 1.1. I don't think this text really adds anything to that text.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This goes beyond what the TD describes in section 11.2.

The proposed text talks specifically about UUIDs, i.e. a format this is well-defined, whereas the TD does not have any format description for identifiers.

@mlagally mlagally changed the title Common constraints - identifiers WIP: Common constraints - identifiers Sep 21, 2022
@mlagally mlagally self-assigned this Feb 8, 2023
@mlagally mlagally changed the title WIP: Common constraints - identifiers Common constraints - identifiers Feb 16, 2023
@mlagally mlagally requested a review from benfrancis February 16, 2023 18:03
@mlagally
Copy link
Contributor Author

I revised the draft taking the feedback from @benfrancis into account. @benfrancis all, please review again.

@benfrancis
Copy link
Member

benfrancis commented Feb 17, 2023

  • A UUID is not a valid URI
  • The HTML in this PR doesn't render correctly
  • The proposed text is very verbose and a lot of it is redundant
  • I think best practice recommendations like this really belong in the Thing Description specification since they apply to all Thing Descriptions, not just those which conform with a profile

I don't have a problem with recommending URNs (containing UUIDs) as IDs, as long as any URI is allowed.

If you really feel that it's important for this recommendation to be made in the Profile specification, I suggest reducing this section down to a single assertion which says something along the lines of:

"It is RECOMMENDED that a Web Thing's Thing Description uses a URN [[URN]] containing a UUID [[rfc4122]] as the value of its id member, so that the Thing has a globally unique identifier."

@egekorkan
Copy link
Contributor

I agree with @benfrancis but the most important thing here is to remove the last assertion since the TD spec says:

Ideally, any required immutable identifiers SHOULD only be made available via affordances, such as a property, whose value can only be obtained after appropriate authentication and authorization, and managed separately from the TD identifier.

Copy link
Member

@benfrancis benfrancis left a comment

Choose a reason for hiding this comment

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

Please see my comments above.

@mlagally mlagally changed the title Common constraints - identifiers WIP: Common constraints - identifiers Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants