mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-18 23:34:04 +02:00
setup knex migration for oauth audience, add localization for en
This commit is contained in:
parent
26c8d22d10
commit
fc225935c3
4 changed files with 14 additions and 4 deletions
12
db/knex_migrations/2025-06-24-0000-add-audience-to-oauth.js
Normal file
12
db/knex_migrations/2025-06-24-0000-add-audience-to-oauth.js
Normal 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();
|
||||||
|
});
|
||||||
|
};
|
|
@ -13,9 +13,6 @@ ALTER TABLE monitor
|
||||||
ALTER TABLE monitor
|
ALTER TABLE monitor
|
||||||
ADD oauth_scopes TEXT default null;
|
ADD oauth_scopes TEXT default null;
|
||||||
|
|
||||||
ALTER TABLE monitor
|
|
||||||
ADD oauth_audience TEXT default null;
|
|
||||||
|
|
||||||
ALTER TABLE monitor
|
ALTER TABLE monitor
|
||||||
ADD oauth_auth_method TEXT default null;
|
ADD oauth_auth_method TEXT default null;
|
||||||
|
|
||||||
|
|
|
@ -71,13 +71,13 @@ exports.decodeJwt = (jwt) => {
|
||||||
* @param {string} clientId The oidc/oauth application client id
|
* @param {string} clientId The oidc/oauth application client id
|
||||||
* @param {string} clientSecret The oidc/oauth application client secret
|
* @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} 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
|
* @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
|
* @returns {Promise<oidc.TokenSet>} TokenSet promise if the token request was successful
|
||||||
*/
|
*/
|
||||||
exports.getOidcTokenClientCredentials = async (tokenEndpoint, clientId, clientSecret, scope, audience, authMethod = "client_secret_basic") => {
|
exports.getOidcTokenClientCredentials = async (tokenEndpoint, clientId, clientSecret, scope, audience, authMethod = "client_secret_basic") => {
|
||||||
const oauthProvider = new oidc.Issuer({ token_endpoint: tokenEndpoint });
|
const oauthProvider = new oidc.Issuer({ token_endpoint: tokenEndpoint });
|
||||||
let client = new oauthProvider.Client({
|
let client = new oauthProvider.Client({
|
||||||
issuer: audience,
|
|
||||||
client_id: clientId,
|
client_id: clientId,
|
||||||
client_secret: clientSecret,
|
client_secret: clientSecret,
|
||||||
token_endpoint_auth_method: authMethod
|
token_endpoint_auth_method: authMethod
|
||||||
|
|
|
@ -1022,6 +1022,7 @@
|
||||||
"Client ID": "Client ID",
|
"Client ID": "Client ID",
|
||||||
"Client Secret": "Client Secret",
|
"Client Secret": "Client Secret",
|
||||||
"OAuth Scope": "OAuth Scope",
|
"OAuth Scope": "OAuth Scope",
|
||||||
|
"OAuth Audience": "OAuth Audience",
|
||||||
"Optional: Space separated list of scopes": "Optional: Space separated list of scopes",
|
"Optional: Space separated list of scopes": "Optional: Space separated list of scopes",
|
||||||
"Go back to home page.": "Go back to home page.",
|
"Go back to home page.": "Go back to home page.",
|
||||||
"No tags found.": "No tags found.",
|
"No tags found.": "No tags found.",
|
||||||
|
|
Loading…
Add table
Reference in a new issue