Mercurial > prosody-modules
comparison mod_http_oauth2/mod_http_oauth2.lua @ 5378:6155c46d9eea
mod_http_oauth2: Record OAuth software id and version attached to tokens
Unsure if these are used anywhere, but `software_id` is supposedly more
unique than `client_uri` which can vary by registration or something?
Software versions can also be good to know e.g. in case there is a
security issue affecting certain versions that could warrant revocation
of tokens issued to it.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 27 Apr 2023 19:16:14 +0200 |
parents | ca477408f90b |
children | 12498c0d705f |
comparison
equal
deleted
inserted
replaced
5377:ca477408f90b | 5378:6155c46d9eea |
---|---|
151 | 151 |
152 -- client_id / client_metadata are pretty large, filter out a subset of | 152 -- client_id / client_metadata are pretty large, filter out a subset of |
153 -- properties that are deemed useful e.g. in case tokens issued to a certain | 153 -- properties that are deemed useful e.g. in case tokens issued to a certain |
154 -- client needs to be revoked | 154 -- client needs to be revoked |
155 local function client_subset(client) | 155 local function client_subset(client) |
156 return { name = client.client_name; uri = client.client_uri }; | 156 return { name = client.client_name; uri = client.client_uri; id = client.software_id; version = client.software_version }; |
157 end | 157 end |
158 | 158 |
159 local function new_access_token(token_jid, role, scope_string, client, id_token, refresh_token_info) | 159 local function new_access_token(token_jid, role, scope_string, client, id_token, refresh_token_info) |
160 local token_data = { oauth2_scopes = scope_string, oauth2_client = nil }; | 160 local token_data = { oauth2_scopes = scope_string, oauth2_client = nil }; |
161 if client then | 161 if client then |