Standardize format of Cadmium Extension document

This commit is contained in:
ChronosX88 2019-12-15 15:51:38 +04:00
parent 6390d43e64
commit 62efe374d6
Signed by: ChronosXYZ
GPG Key ID: 085A69A82C8C511A

View File

@ -0,0 +1,93 @@
# The Sections of a Cadmium Extension (CE) document
## Introduction
The introduction to a CE document should contain description of the extension and example of problems which this extension can solve.
## Glossary
If your CE document uses terms that may not be familiar to the reader, please define them in this section.
## Use Cases
It is recommended that document authors structure their proposals according to the use cases that the proposal will address. We have found that use cases force authors to focus on functionality rather than "protocol for the sake of protocol". It is also helpful to sort use cases by actor, as is done in Multi-User Chat (XEP-0045), for example. Include one subsection for each use case.
When writing use cases and the associated protocols, make sure to:
* Clearly define the success scenarios, alternate flows, and possible errors.
* Describe the expected behavior of XMPP clients, servers, and components when using this protocol.
* Include lots of protocol examples.
*Example 1. An Example from Shakespeare*
```json
{
"id": "abcd",
"type": "profile:login",
"to": "cadmium.org",
"payload": {
"username": "juliet",
"password": "romeo1"
}
}
```
## Error Codes
If your proposal defines a number of error and status codes, it is a good idea to include a table of all the codes defined in your document.
## Business Rules
You may want to include a section describing various business rules (essentially, a variety of MUSTs, SHOULDs, and MAYs regarding application behavior). This is not required but can be helpful to implementers.
## Implementation Notes
You may want to include a section devoted to implementation notes. Again, this is not required but can be helpful to implementers.
## Internationalization Considerations (?)
If there are any internationalization or localization issues related to your proposal, define them in this optional section.
## Security Considerations
Your proposal MUST include a section entitled "Security Considerations". Even if there are no security features or concerns related to your proposal, you MUST note that fact. For helpful guidelines, refer to RFC 3552.
## JSON Schema
An XML Schema is required in order for protocols to be approved by the XMPP Council. The XMPP Extensions Editor team can assist you in defining an XML Schema for the protocol you are proposing.
## Acknowledgements (optional)
Most XEP documents end with a section thanking non-authors who have made significant contributions or who have provided feedback regarding the specification.
# Cadmium Extension Styleguide
CE document are written in English. It is not expected that you will be a fine prose writer, but try to write in a clear, easily-understood fashion.
## Attributes
When talking about an attribute by name, refer to it in single quotes. Example: the 'to' attribute.
When talking about the value of an attribute, refer to it in double quotes. Example: the value of the 'subscription' attribute is "both".
Elements possess attributes and contain character data and/or child elements; do not confuse these terms.
## Code Examples
To show the hierarchy of JSON Objects, indent two spaces for every level.
If an element possesses a large number of attributes, include a line break before each attribute and indent them so that they are vertically aligned for readability.
If the JSON data of an element is long, include line breaks and indent by two spaces.
*Example*:
```json
{
"id": "abcd",
"type": "profile:register",
"to": "cadmium.org",
"payload": {
"username": "juliet",
"thirdPIDs": [
{"type":"email", "value":"juliet@capulett.com"},
{"type":"msisdn", "value":"+1234567890"},
],
"password": "romeo1"
}
}
```
Some examples include strings that are the output of a hashing algorithm such as SHA-1 or SHA-256. An easy way to generate these is to use the OpenSSL "dgst" command to generate the hash. For example, the following command will generate the SHA-1 hash `9f5f9fdab9da7fc12e3c52b258acbcb4bb8e66ac`:
```
echo -n 'bard@shakespeare.lit' | openssl dgst -hex -sha1
```
Some examples include strings that are encoded using Base64. An easy way to generate these is to use the OpenSSL "enc" command to generate the base64-encoded equivalent. For example, the following command will generate the base64-encoded string `YmFyZEBzaGFrZXNwZWFyZS5saXQ=`:
```
echo -n 'bard@shakespeare.lit' | openssl enc -nopad -base64
```
## Conformance Terms
Conformance terms (e.g,, "MUST" and "SHOULD") are specified in RFC 2119. Use them. When such terms are not in ALL CAPS, the special conformance sense does not apply (although it is preferable to use terms such as 'might' instead of 'may' and 'ought' instead of 'should').