setup knex migration for oauth audience, add localization for en

This commit is contained in:
Ryan Hartje 2025-06-24 23:56:41 -05:00
parent 26c8d22d10
commit fc225935c3
Failed to extract signature
4 changed files with 14 additions and 4 deletions

View file

@ -0,0 +1,12 @@
exports.up = function (knex) {
return knex.schema
.alterTable("monitor", function (table) {
table.string("oauth_audience").nullable().defaultTo(null);
});
};
exports.down = function (knex) {
return knex.schema.alterTable("monitor", function (table) {
table.string("oauth_audience").alter();
});
};

View file

@ -13,9 +13,6 @@ ALTER TABLE monitor
ALTER TABLE monitor
ADD oauth_scopes TEXT default null;
ALTER TABLE monitor
ADD oauth_audience TEXT default null;
ALTER TABLE monitor
ADD oauth_auth_method TEXT default null;

View file

@ -71,13 +71,13 @@ exports.decodeJwt = (jwt) => {
* @param {string} clientId The oidc/oauth application client id
* @param {string} clientSecret The oidc/oauth application client secret
* @param {string} scope The scope(s) for which the token should be issued for
* @param {string} audience The audience for which the token should be issued for
* @param {string} authMethod The method used to send the credentials. Default client_secret_basic
* @returns {Promise<oidc.TokenSet>} TokenSet promise if the token request was successful
*/
exports.getOidcTokenClientCredentials = async (tokenEndpoint, clientId, clientSecret, scope, audience, authMethod = "client_secret_basic") => {
const oauthProvider = new oidc.Issuer({ token_endpoint: tokenEndpoint });
let client = new oauthProvider.Client({
issuer: audience,
client_id: clientId,
client_secret: clientSecret,
token_endpoint_auth_method: authMethod

View file

@ -1022,6 +1022,7 @@
"Client ID": "Client ID",
"Client Secret": "Client Secret",
"OAuth Scope": "OAuth Scope",
"OAuth Audience": "OAuth Audience",
"Optional: Space separated list of scopes": "Optional: Space separated list of scopes",
"Go back to home page.": "Go back to home page.",
"No tags found.": "No tags found.",