1
0
Fork 0
mirror of synced 2024-06-29 11:31:06 +12:00

Pre-review tidy, add new badge to plugins

This commit is contained in:
Rory Powell 2022-09-15 11:23:51 +01:00
parent 0980be9377
commit ff8760e860
5 changed files with 12 additions and 17 deletions

View file

@ -6,6 +6,7 @@ exports.UserStatus = {
exports.Cookies = { exports.Cookies = {
CurrentApp: "budibase:currentapp", CurrentApp: "budibase:currentapp",
Auth: "budibase:auth", Auth: "budibase:auth",
Init: "budibase:init",
RETURN_URL: "budibase:returnurl", RETURN_URL: "budibase:returnurl",
DatasourceAuth: "budibase:datasourceauth", DatasourceAuth: "budibase:datasourceauth",
OIDC_CONFIG: "budibase:oidc:config", OIDC_CONFIG: "budibase:oidc:config",

View file

@ -10,7 +10,6 @@ import { getGlobalDB, doInTenant } from "../tenancy"
import { decrypt } from "../security/encryption" import { decrypt } from "../security/encryption"
const identity = require("../context/identity") const identity = require("../context/identity")
const env = require("../environment") const env = require("../environment")
import { User } from "@budibase/types"
const ONE_MINUTE = env.SESSION_UPDATE_PERIOD || 60 * 1000 const ONE_MINUTE = env.SESSION_UPDATE_PERIOD || 60 * 1000
@ -68,11 +67,7 @@ async function checkApiKey(apiKey: string, populateUser?: Function) {
*/ */
export = ( export = (
noAuthPatterns = [], noAuthPatterns = [],
opts: { opts: { publicAllowed: boolean; populateUser?: Function } = {
publicAllowed: boolean
populateUser?: Function
checkDayPass?: (ctx: any, user: User, tenantId: string) => Promise<void>
} = {
publicAllowed: false, publicAllowed: false,
} }
) => { ) => {
@ -112,10 +107,7 @@ export = (
} }
user.csrfToken = session.csrfToken user.csrfToken = session.csrfToken
if ( if (session?.lastAccessedAt < timeMinusOneMinute()) {
!session.lastAccessedAt ||
session.lastAccessedAt < timeMinusOneMinute()
) {
// make sure we denote that the session is still in use // make sure we denote that the session is still in use
await updateSessionTTL(session) await updateSessionTTL(session)
} }

View file

@ -54,7 +54,11 @@
: undefined, : undefined,
{ title: "Auth", href: "/builder/portal/manage/auth" }, { title: "Auth", href: "/builder/portal/manage/auth" },
{ title: "Email", href: "/builder/portal/manage/email" }, { title: "Email", href: "/builder/portal/manage/email" },
{ title: "Plugins", href: "/builder/portal/manage/plugins" }, {
title: "Plugins",
href: "/builder/portal/manage/plugins",
badge: "New",
},
{ {
title: "Organisation", title: "Organisation",

View file

@ -2,8 +2,6 @@ const { BUILTIN_ROLE_IDS } = require("@budibase/backend-core/roles")
const { checkPermissionsEndpoint } = require("./utilities/TestFunctions") const { checkPermissionsEndpoint } = require("./utilities/TestFunctions")
const setup = require("./utilities") const setup = require("./utilities")
jest.setTimeout(100000)
jest.mock("../../../utilities/workerRequests", () => ({ jest.mock("../../../utilities/workerRequests", () => ({
getGlobalUsers: jest.fn(() => { getGlobalUsers: jest.fn(() => {
return {} return {}

View file

@ -1,11 +1,11 @@
import { PriceDuration } from "./plan" import { PriceDuration } from "./plan"
export interface CustomerBilling { export interface Customer {
balance: number | null | undefined balance: number | null | undefined
currency: string | null | undefined currency: string | null | undefined
} }
export interface SubscriptionBilling { export interface Subscription {
amount: number amount: number
quantity: number quantity: number
duration: PriceDuration duration: PriceDuration
@ -15,6 +15,6 @@ export interface SubscriptionBilling {
} }
export interface Billing { export interface Billing {
customer: CustomerBilling customer: Customer
subscription?: SubscriptionBilling subscription?: Subscription
} }