Replies: 7 comments 11 replies
-
I like this proposal.
|
Beta Was this translation helpful? Give feedback.
-
I also thought that this standard security information possibly only needs to be provided at an API or interface level — it is unlikely that an API or interface will be controlled via a specific permissions API directive, but a specific member won't. And for cases where this does not hold true (there are always edge cases), you could do it in a way where you apply the data at an API level and it applies it to all interfaces and members below that, but then if you apply the data at a node lower in the chain, it overrides it. Maybe also provide a flag that turns off the default recursive application, just in case? |
Beta Was this translation helpful? Give feedback.
-
Looking at openwebdocs/project#146 project I feel like we might need separate permission front matter for permission API and for permissions policy. The permissions for both mechanisms have the same names, but are different entities - i.e. the requirement to ask for user permission to use an API does not necessarily mean that there can be a permission policy, and visa versa.
or
Further, it might be useful to display the permission BCD or a link to it - so if you're documenting API X then in its security or compatibility section, also add https://developer.mozilla.org/en-US/docs/Web/API/Permissions#browser_support line |
Beta Was this translation helpful? Give feedback.
-
I don't think I like this data structure very much though: security-requirements:
- secure-context
- cross-origin-isolation
- user-activation: transient
- permission-api:
- clipboard-read
- clipboard-write
- permission-policy:
- clipboard-read
- clipboard-write In JSON this translates to: {
"security-requirements": [
"secure-context",
"cross-origin-isolation",
{
"user-activation": "transient"
},
{
"permission-api": [
"clipboard-read",
"clipboard-write"
]
},
{
"permission-policy": [
"clipboard-read",
"clipboard-write"
]
}
]
} ...which is really awkward to work with - if you want to find out the permissions policy for a feature, you have to iterate the items, looking for an item which is an object with a security-requirements:
flags:
- secure-context
- cross-origin-isolation
user-activation: sticky
permission-api:
- clipboard-read
- clipboard-write
permission-policy:
- clipboard-read
- clipboard-write ...which would give us: {
"security-requirements": {
"flags": ["secure-context", "cross-origin-isolation"],
"user-activation": "sticky",
"permission-api": ["clipboard-read", "clipboard-write"],
"permission-policy": ["clipboard-read", "clipboard-write"]
}
} ...so to find the permissions policy you just have to look for the security-requirements:
secure-context: true
cross-origin-isolation: true
user-activation: sticky
permission-api:
- clipboard-read
- clipboard-write
permission-policy:
- clipboard-read
- clipboard-write ...but that's redundant if on/off switches are only present if they are on. So I like |
Beta Was this translation helpful? Give feedback.
-
We may need three options for user activation: What I mean here is that often the user activation requirement is not in the spec, and is done differently in different browsers. I'm thinking of autoplay behaviour for audio/video with sound - in some browsers transient activation is required while in others sticky activation is sufficient. |
Beta Was this translation helpful? Give feedback.
-
Splitting a concrete proposal for security requirements metadata out of https://github.com/orgs/mdn/discussions/288#discussioncomment-7452307. The proposal is to have a structure like: security-requirements:
flags:
- secure-context
- cross-origin-isolation
user-activation: sticky
permission-api:
- clipboard-read
- clipboard-write
permission-policy:
- clipboard-read
- clipboard-write or in JSON: {
"security-requirements": {
"flags": ["secure-context", "cross-origin-isolation"],
"user-activation": "sticky",
"permission-api": ["clipboard-read", "clipboard-write"],
"permission-policy": ["clipboard-read", "clipboard-write"]
}
} The
We might think of this proposal as independent from discussions about where this might live (for example in MDN page front matter). For now, is this a sensible structure and does it properly capture the security requirements we want it to capture? |
Beta Was this translation helpful? Give feedback.
-
I looked into what the implications, benefits, and drawbacks of using WebIDL to provide values for "secure context required": https://github.com/wbamberg/securecontext-checker/blob/main/secure-context-analysis.md. Summary:
|
Beta Was this translation helpful? Give feedback.
-
There was a discussion about how to best record and display security requirements of APIs in mdn/content#20435. It should be a real discussion thread, so I'm moving it here. Recently, this came up again in mdn/content#22387 after mdn/content#22303 was filed.
Certain web platform APIs are only available behind certain security requirements, for example:
SharedArrayBuffer
and others.In mdn/content#20435, I created a "Security" section on API pages to mention these requirements. There are two problems with this, though: 1) It is not visible enough. 2) It is not structured enough.
In the PR we already discussed how this could be done in front-matter instead. A rough proposal:
(Note that the "secure-context" requirement could also be queried from webidl directly).
This front matter information could then be used to create a banner (or similar) that talks about all security requirements. How and where to display it could then be experimented with to solve the visibility problem best.
Beta Was this translation helpful? Give feedback.
All reactions