<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.21 (Ruby 3.3.4) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-mahy-mimi-app-components-00" category="info" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.25.0 -->
  <front>
    <title abbrev="MIMI Application State">Application State Components for More Instant Messaging Interoperability (MIMI)</title>
    <seriesInfo name="Internet-Draft" value="draft-mahy-mimi-app-components-00"/>
    <author fullname="Rohan Mahy">
      <organization>Rohan Mahy Consulting Service</organization>
      <address>
        <email>rohan.ietf@gmail.com</email>
      </address>
    </author>
    <date year="2024" month="December" day="18"/>
    <area>Applications and Real-Time</area>
    <workgroup>More Instant Messaging Interoperability</workgroup>
    <keyword>participant list</keyword>
    <keyword>roles</keyword>
    <keyword>capabilities</keyword>
    <keyword>room metadata</keyword>
    <keyword>components registry</keyword>
    <abstract>
      <?line 39?>

<t>TODO Abstract</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://rohanmahy.github.io/mimi-app-components/draft-mahy-mimi-app-components.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-mahy-mimi-app-components/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        More Instant Messaging Interoperability Working Group mailing list (<eref target="mailto:mimi@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/mimi/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/mimi/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/rohanmahy/mimi-app-components"/>.</t>
    </note>
  </front>
  <middle>
    <?line 44?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>TODO Introduction</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      <?line -18?>

</section>
    <section anchor="room-metadata">
      <name>Room Metadata</name>
      <t>The Room Metadata component contains data about a room which might be displayed as human-readable information for the room, such as the name of a room and its room image/avatar.</t>
      <t>RoomMetaData is the format of the <tt>data</tt> field inside the ComponentData struct for the Room Metadata component in the <tt>application_data</tt> GroupContext extension.</t>
      <sourcecode type="tls"><![CDATA[
/* a valid URI (ex: MIMI URI) */
struct {
  opaque uri<V>;
} Uri;

/* a sequence of valid UTF8 without nulls */
struct {
  opaque string<V>;
} UTF8String;

struct {
  Uri room_uri;
  UTF8String room_name;
  /* an https URI resolving to an avatar image */
  Uri room_avatar;
  UTF8String room_subject;
  UTF8String room_mood;
} RoomMetaData;

RoomMetaData RoomMetaUpdate;
]]></sourcecode>
      <t>RoomMetaUpdate (which has the same format as RoomMetaData) is the format of the <tt>update</tt> field inside the ApplicationDataUpdate struct in an ApplicationDataUpdate Proposal for the Room Metadata component.
If the contents of the <tt>update</tt> field are valid and if the proposer is authorized to generate such an update, the value of the <tt>update</tt> field completely replaces the value of the <tt>data</tt> field.</t>
    </section>
    <section anchor="role-based-access-control">
      <name>Role-Based Access Control</name>
      <t>The Role-Based Access Control component contains a list of all the roles in the room, and the capabilities associated with them.
It contains a role_index, which is used to refer to the role elsewhere.
It also contains a role_name (a human readable text string name for the
role), and a role_description (another string, which can have zero length).</t>
      <t>Each Role also can contain constraints on the minimum and maximum number of participants, and the minimum and maximum number of active participants.
If the minimum number is zero, there is no minimum number of participants for that particular role.
If there is no maximum number of participants for a particular role, that parameter is absent.</t>
      <t>RoleData is the format of the <tt>data</tt> field inside the ComponentData struct for the Role-Based Access Control component in the <tt>application_data</tt> GroupContext extension.</t>
      <sourcecode type="tls"><![CDATA[
/* See MIMI Capability Types IANA registry */
uint16 CapablityType;

struct {
  int role_index;
  opaque role_name<V>;
  opaque role_description<V>;
  CapabilityType role_capabilities<V>;
  int minimum_participants_constraint;
  optional int maximum_participants_constraint;
  int minimum_active_participants_constraint;
  optional int maximum_active_participants_constraint;
} Role;

struct {
  Role roles<V>;
} RoleData;

RoleData RoleUpdate;
]]></sourcecode>
      <t>RoleUpdate (which has the same format as RoleData) is the format of the <tt>update</tt> field inside the ApplicationDataUpdate struct in an ApplicationDataUpdate Proposal for the Role-Based Access Control component.
If the contents of the <tt>update</tt> field are valid and if the proposer is authorized to generate such an update, the value of the <tt>update</tt> field completely replaces the value of the <tt>data</tt> field.</t>
    </section>
    <section anchor="participant-list">
      <name>Participant List</name>
      <t>The participant list is a list of "users" in a room. Each user is assigned one
role (expressed as the role_index) in the room.</t>
      <sourcecode type="tls"><![CDATA[
struct {
  opaque user<V>;
  int role_index;
} UserRolePair;

struct {
  uint32 user_index;
  int role_index;
} UserindexRolePair

struct {
  UserRolePair participants<V>;
} ParticipantListData;

struct {
  uint32 removedIndices<V>;
  UserindexRolePair changedRoleParticipants<V>
  UserRolePair addedParticipants<V>;
} ParticipantListUpdate;
]]></sourcecode>
      <t>ParticipantListUpdate is the contents of an ApplicationDataUpdate Proposal with the component ID for the participant list.</t>
    </section>
    <section anchor="preauthorized-participants">
      <name>Preauthorized Participants</name>
      <t>Preauthorized Participants are MIMI users who have authorization to adopt a role in a room by virtue of certain credential claims or properties, as opposed to being individually enumerated in the participant list.
For example, a room for employee benefits might be available to join with the regular participant role to all employees with a residence in a specific country; anyone working in the human resources department might be able to join the same room as a moderator.</t>
      <t>PreAuthData is the format of the <tt>data</tt> field inside the ComponentData struct for the Preauthorized Participants component in the <tt>application_data</tt> GroupContext extension.</t>
      <sourcecode type="tls"><![CDATA[
struct {
  int target_role_index;
  /* preauth_domain consists of ASCII letters, digits, and hyphens */
  opaque preauth_domain<V>;
  /* the remaining fields are in the form of a URI */
  opaque preauth_workgroup<V>;
  opaque preauth_group<V>;
  opaque preauth_user<V>;
} PreAuthPerRoleList;

struct {
  /* MLS Credential Type of the "claim"  */
  CredentialType credential_type;
  /* the binary representation of an X.509 OID, a JWT claim name string, */
  /* or the CBOR representation of a CWT claim (an int or tstr) */
  opaque id<V>;
} ClaimId;

struct {
  ClaimId claim_id;
  opaque claim_value<V>;
} Claim;

struct {
  /* when all claims in the claimset are satisfied, claimset is satisfied */
  Claim claimset<V>;
  Role target_role;
} PreAuthRoleEntry;

struct {
  PreAuthRoleEntry preauthorized_entries<V>;
} PreAuthData;

PreAuthData PreAuthUpdate;
]]></sourcecode>
      <t>PreAuthUpdate (which has the same format as PreAuthData) is the format of the <tt>update</tt> field inside the ApplicationDataUpdate struct in an ApplicationDataUpdate Proposal for the Preauthorized Participants component.
If the contents of the <tt>update</tt> field are valid and if the proposer is authorized to generate such an update, the value of the <tt>update</tt> field completely replaces the value of the <tt>data</tt> field.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>TODO Security</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <section anchor="new-mimi-role-capabilities-registry">
        <name>New MIMI Role Capabilities registry</name>
        <t>Create a new registry with the following values assigned sequentially using the reference RFCXXXX.</t>
        <artwork><![CDATA[
canAddParticipant
canRemoveParticipant
canAddOwnClient
canRemoveSelf
canAddSelf
canCreateJoinLink
canUseJoinLink
canUnBan
canKick
canRevokeVoice
canGrantVoice
canKnock
canAcceptKnock
canChangeUserRole
canCreateSubgroup
canTargetMessage
canReceiveMessage
canReportAbuse
canReactToMessage
canEditReaction
canDeleteReaction
canEditOwnMessage
canDeleteOwnMessage
canDeleteAnyMessage
canStartTopic
canReplyInTopic
canSendDirectMessage
canTargetMessage
canUploadVideo
canUploadAttachment
canDownloadImage
canDownloadVideo
canDownloadAttachment
canSendLink
canSendLinkPreview
canFollowLink
canChangeRoomSubject
canChangeRoomAvatar
canChangeOwnName
canChangeOwnPresence
canChangeOwnMood
canChangeOwnAvatar
canJoinCall
canSendAudio
canReceiveAudio
canSendVideo
canReceiveVideo
canShareScreen
canViewSharedScreen
canChangeOtherPolicyAttribute
canDestroyRoom
canSendMLSUpdateProposal
cansendMLSReinitProposal
canSendMLSPSKProposal
canSendMLSExternalProposal
canSendMLSExternalCommit
]]></artwork>
      </section>
    </section>
  </middle>
  <back>
    <references anchor="sec-normative-references">
      <name>Normative References</name>
      <reference anchor="RFC2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner"/>
          <date month="March" year="1997"/>
          <abstract>
            <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC8174">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba" initials="B." surname="Leiba"/>
          <date month="May" year="2017"/>
          <abstract>
            <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
    </references>
    <?line 293?>

<section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA91ZbW8bNxL+vr+Cp3yJg8iO29xdaufSKrLdqvHbWXba4nBw
qV1KYr1LbkmuFCVIfsv9lvtl9wy5r7Jst7gABVog9XI4HA7n5Zkh1e/3Iydd
KvZYb5DnqYy5k1qxseNOsKHOcq2EcpZNtWEn2gg2UtZx5diJsJbPpJqB4oTR
uTB8IlPpVuzxyehktNWL+GRixAKSacxuie9FGImZNqs9JtVUR1GiY8Uz6JIY
PnX9jM9X/Uxmss/zvB/XyvSfPYtsMcmktRDmVjlWjA4vjxh7xHhqNXaUKhG5
wP+U6z1lPZFIp43kKQ1Gg9f4g/P0RheXR71IFdlEmL0ogTZ7UayVFcoWdo85
U4gI+n8ZcSN410KWcZWwC8HT/qXMcJalNjczo4uczvvbDNWLbsQK65K9iPVZ
zo2TscxpTSqtI5rRqbD0EfM8LJJhbLTOWCYch9LcMzSuMmKG5WYVLYQqcCLG
frdejAWr9n7AqYjlW5JA9IzLFHTyyjdSuOm2NjOicxPPQZ87l9u9nR1iI5Jc
iO2KbYcIOxOjl1bskIAdWjiTbl5MsNToOVfk8p0NLifOFP6xrrVJvWI7CNmW
etPanfujaXvusrQXRbxwc23IFdiLsWmRpiEYL2gbdoLlfgIn4Uq+91HQnkS2
IGxSR+YaC7OQsfD8IpjMK+tt8c2MKNvQIIqUNhkkLeCmiHKgGUX9fp/xCRzJ
YxdFl2cHZ2xQD/1sJpMkFVH0iDxodFLEpFPJ2yWBB+ohIJrYPRBTqaQfY8lc
MAQjo2i0CJSr8SWlCv1lp2f+++Lwn1eji8MD+h5/Nzg+rj+ikmP83dnV8UHz
1awcnp2cHJ4ehMWgsg4p6p0MfsIMadU7O78cnZ0OjnvABObm0jKgQpFBc8SY
YE6zicAUIjY3womEcRsl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