annotate mod_http_stats_stream/README.markdown @ 5404:1087f697c3f3

mod_http_oauth2: Strip unknown extra fields from client registration We shouldn't sign things we don't understand! RFC 7591 section-2 states: > The authorization server MUST ignore any client metadata sent by the > client that it does not understand (for instance, by silently removing > unknown metadata from the client's registration record during > processing). Prevents grandfathering in of unvalidated data that might become used later, especially since the 'additionalProperties' schema keyword was removed in 698fef74ce53
author Kim Alvefur <zash@zash.se>
date Tue, 02 May 2023 16:23:40 +0200
parents bac3dae031ee
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2480
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
1 ---
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
2 depends:
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
3 - 'mod\_http'
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
4 provides:
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
5 - http
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
6 ---
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
7
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
8 # Introduction
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
9
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
10 This module provides a streaming interface to [Prosodys internal statistics][doc:statistics] via
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
11 [Server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events).
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
12
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
13 ## Example
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
14
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
15 ```js
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
16 var evtSource = new EventSource("/stats_stream");
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
17
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
18 /*
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
19 * An event with all current statistics in the form of a JSON object.
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
20 * Normally sent only once, when first connected to the stream.
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
21 */
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
22 evtSource.addEventListener("stats-full", function(e) {
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
23 var initial_stats = JSON.parse(e.data);
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
24 console.log(initial_stats);
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
25 }, false);
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
26
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
27 /*
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
28 * An event containing only statistics that have changed since the last
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
29 * 'stats-full' or 'stats-updated' event.
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
30 */
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
31 evtSource.addEventListener("stats-updated", function(e) {
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
32 var updated_stats = JSON.parse(e.data);
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
33 console.log(updated_stats);
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
34 }, false);
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
35 ```
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
36
3643
740870196b97 mod_http_stats_stream: Make global to simplify
Kim Alvefur <zash@zash.se>
parents: 2480
diff changeset
37 # Compatibility
2480
c98b37d6d86c mod_http_stats_stream: Add a README
Kim Alvefur <zash@zash.se>
parents:
diff changeset
38
4595
bac3dae031ee Add note of incompatibility with trunk since 5f15ab7c6ae5
Kim Alvefur <zash@zash.se>
parents: 3643
diff changeset
39 * Prosody \>= 0.11.0
bac3dae031ee Add note of incompatibility with trunk since 5f15ab7c6ae5
Kim Alvefur <zash@zash.se>
parents: 3643
diff changeset
40 * Trunk < [5f15ab7c6ae5](https://hg.prosody.im/trunk/rev/5f15ab7c6ae5)