view mod_bookmarks2/tests/conversion.scs @ 5193:2bb29ece216b

mod_http_oauth2: Implement stateless dynamic client registration Replaces previous explicit registration that required either the additional module mod_adhoc_oauth2_client or manually editing the database. That method was enough to have something to test with, but would not probably not scale easily. Dynamic client registration allows creating clients on the fly, which may be even easier in theory. In order to not allow basically unauthenticated writes to the database, we implement a stateless model here. per_host_key := HMAC(config -> oauth2_registration_key, hostname) client_id := JWT { client metadata } signed with per_host_key client_secret := HMAC(per_host_key, client_id) This should ensure everything we need to know is part of the client_id, allowing redirects etc to be validated, and the client_secret can be validated with only the client_id and the per_host_key. A nonce injected into the client_id JWT should ensure nobody can submit the same client metadata and retrieve the same client_secret
author Kim Alvefur <zash@zash.se>
date Fri, 03 Mar 2023 21:14:19 +0100
parents d835cb7d2b47
children
line wrap: on
line source

# Pubsub: Bookmarks 2.0

[Client] Juliet-old
	jid: admin@localhost
	password: password

[Client] Juliet-new
	jid: admin@localhost
	password: password

// admin@localhost is assumed to have node creation privileges

---------

Juliet-new connects

-- Generated with https://gitlab.com/xmpp-rs/xmpp-parsers:
-- cargo run --example=generate-caps https://code.matthewwild.co.uk/scansion/ <<< "<query xmlns='http://jabber.org/protocol/disco#info'><identity category='client' name='scansion' type='bot'/><feature var='http://jabber.org/protocol/disco#info'/><feature var='urn:xmpp:bookmarks:1+notify'/></query>"
Juliet-new sends:
	<presence id='presence0'>
		<c xmlns='http://jabber.org/protocol/caps'
		   hash='sha-1'
		   node='https://code.matthewwild.co.uk/scansion/'
		   ver='CPuQARM1gCTq2f6/ZjHUzWL2QHg='/>
		<c xmlns='urn:xmpp:caps'>
			<hash xmlns='urn:xmpp:hashes:2' algo='sha-256'>OTy9GPCvBZRvqzOHmD/ThA1WbBH3tNoeKbdqKQCRPHc=</hash>
			<hash xmlns='urn:xmpp:hashes:2' algo='sha3-256'>f/rxDeTf6HyjQ382V3GEG/UfAs5IeclC05jBSBnVQCI=</hash>
			<hash xmlns='urn:xmpp:hashes:2' algo='blake2b-256'>ucfqg/NrLj0omE+26hYMrbpcmxHcU4Z3hfAQIF+6tt0=</hash>
		</c>
	</presence>

Juliet-new receives:
	<iq from="${Juliet-new's JID}" id='disco' type='get'>
		<query xmlns='http://jabber.org/protocol/disco#info' node='https://code.matthewwild.co.uk/scansion/#CPuQARM1gCTq2f6/ZjHUzWL2QHg='/>
	</iq>

Juliet-new sends:
	<iq to="${Juliet-new's JID}" id='disco' type='result'>
		<query xmlns='http://jabber.org/protocol/disco#info' node='https://code.matthewwild.co.uk/scansion/#CPuQARM1gCTq2f6/ZjHUzWL2QHg='>
			<identity category='client' name='scansion' type='bot'/>
			<feature var='http://jabber.org/protocol/disco#info'/>
			<feature var='urn:xmpp:bookmarks:1+notify'/>
		</query>
	</iq>

Juliet-old connects

Juliet-old sends:
	<iq type='get' id='get0'>
		<query xmlns='jabber:iq:private'>
			<storage xmlns='storage:bookmarks'/>
		</query>
	</iq>

Juliet-old receives:
	<iq type='result' id='get0'>
		<query xmlns='jabber:iq:private'>
			<storage xmlns='storage:bookmarks'/>
		</query>
	</iq>

Juliet-old sends:
	<iq type='set' id='pub0'>
		<query xmlns='jabber:iq:private'>
			<storage xmlns='storage:bookmarks'>
				<conference name='The Play&apos;s the Thing'
					    autojoin='true'
					    jid='theplay@conference.shakespeare.lit'>
					<nick>JC</nick>
				</conference>
			</storage>
		</query>
	</iq>

Juliet-new receives:
	<message type='headline' from="${Juliet-new's JID}">
		<event xmlns='http://jabber.org/protocol/pubsub#event'>
			<items node='urn:xmpp:bookmarks:1'>
				<item id='theplay@conference.shakespeare.lit'>
					<conference xmlns='urn:xmpp:bookmarks:1'
					            name='The Play&apos;s the Thing'
					            autojoin='true'>
						<nick>JC</nick>
					</conference>
				</item>
			</items>
		</event>
	</message>

Juliet-old receives:
	<iq type='result' id='pub0'/>

Juliet-old sends:
	<iq type='get' id='get1'>
		<query xmlns='jabber:iq:private'>
			<storage xmlns='storage:bookmarks'/>
		</query>
	</iq>

Juliet-old receives:
	<iq type='result' id='get1'>
		<query xmlns='jabber:iq:private'>
			<storage xmlns='storage:bookmarks'>
				<conference name='The Play&apos;s the Thing'
					    autojoin='true'
					    jid='theplay@conference.shakespeare.lit'>
					<nick>JC</nick>
				</conference>
			</storage>
		</query>
	</iq>

Juliet-old sends:
	<iq type='set' id='pub1'>
		<query xmlns='jabber:iq:private'>
			<storage xmlns='storage:bookmarks'>
				<conference name='The Play&apos;s the Thing'
					    autojoin='true'
					    jid='theplay@conference.shakespeare.lit'>
					<nick>JC</nick>
				</conference>
				<conference name='The Orchard'
					    autojoin='true'
					    jid='orchard@conference.shakespeare.lit'>
					<nick>JC</nick>
				</conference>
			</storage>
		</query>
	</iq>

Juliet-new receives:
	<message type='headline' from="${Juliet-new's JID}">
		<event xmlns='http://jabber.org/protocol/pubsub#event'>
			<items node='urn:xmpp:bookmarks:1'>
				<item id='orchard@conference.shakespeare.lit'>
					<conference xmlns='urn:xmpp:bookmarks:1'
					            name='The Orchard'
					            autojoin='true'>
						<nick>JC</nick>
					</conference>
				</item>
			</items>
		</event>
	</message>

Juliet-old receives:
	<iq type='result' id='pub1'/>

Juliet-old sends:
	<iq type='get' id='get2'>
		<query xmlns='jabber:iq:private'>
			<storage xmlns='storage:bookmarks'/>
		</query>
	</iq>

Juliet-old receives:
	<iq type='result' id='get2'>
		<query xmlns='jabber:iq:private'>
			<storage xmlns='storage:bookmarks'>
				<conference name='The Play&apos;s the Thing'
					    autojoin='true'
					    jid='theplay@conference.shakespeare.lit'>
					<nick>JC</nick>
				</conference>
				<conference name='The Orchard'
					    autojoin='true'
					    jid='orchard@conference.shakespeare.lit'>
					<nick>JC</nick>
				</conference>
			</storage>
		</query>
	</iq>

Juliet-old sends:
	<iq type='set' id='retract0'>
		<query xmlns='jabber:iq:private'>
			<storage xmlns='storage:bookmarks'>
				<conference name='The Orchard'
					    autojoin='true'
					    jid='orchard@conference.shakespeare.lit'>
					<nick>JC</nick>
				</conference>
			</storage>
		</query>
	</iq>

Juliet-new receives:
	<message type='headline' from="${Juliet-new's JID}">
		<event xmlns='http://jabber.org/protocol/pubsub#event'>
			<items node='urn:xmpp:bookmarks:1'>
				<retract id='theplay@conference.shakespeare.lit'/>
			</items>
		</event>
	</message>

Juliet-old receives:
	<iq type='result' id='retract0'/>

Juliet-old sends:
	<iq type='get' id='get3'>
		<query xmlns='jabber:iq:private'>
			<storage xmlns='storage:bookmarks'/>
		</query>
	</iq>

Juliet-old receives:
	<iq type='result' id='get3'>
		<query xmlns='jabber:iq:private'>
			<storage xmlns='storage:bookmarks'>
				<conference name='The Orchard'
					    autojoin='true'
					    jid='orchard@conference.shakespeare.lit'>
					<nick>JC</nick>
				</conference>
			</storage>
		</query>
	</iq>

Juliet-old sends:
	<iq type='set' id='purge0'>
		<query xmlns='jabber:iq:private'>
			<storage xmlns='storage:bookmarks'/>
		</query>
	</iq>

Juliet-new receives:
	<message type='headline' from="${Juliet-new's JID}">
		<event xmlns='http://jabber.org/protocol/pubsub#event'>
			<purge node='urn:xmpp:bookmarks:1'/>
		</event>
	</message>

Juliet-old receives:
	<iq type='result' id='purge0'/>

Juliet-old sends:
	<iq type='get' id='get4'>
		<query xmlns='jabber:iq:private'>
			<storage xmlns='storage:bookmarks'/>
		</query>
	</iq>

Juliet-old receives:
	<iq type='result' id='get4'>
		<query xmlns='jabber:iq:private'>
			<storage xmlns='storage:bookmarks'/>
		</query>
	</iq>

Juliet-old disconnects

Juliet-new disconnects

// vim: syntax=xml: