Merge branch 'develop' of github.com:Budibase/budibase into peek-screen
This commit is contained in:
commit
3916b735a1
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "0.9.87-alpha.1",
|
||||
"version": "0.9.87-alpha.3",
|
||||
"npmClient": "yarn",
|
||||
"packages": [
|
||||
"packages/*"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/auth",
|
||||
"version": "0.9.87-alpha.1",
|
||||
"version": "0.9.87-alpha.3",
|
||||
"description": "Authentication middlewares for budibase builder and apps",
|
||||
"main": "src/index.js",
|
||||
"author": "Budibase",
|
||||
|
|
|
@ -6,6 +6,7 @@ const { authError } = require("./utils")
|
|||
const { newid } = require("../../hashing")
|
||||
const { createASession } = require("../../security/sessions")
|
||||
const { getGlobalUserByEmail } = require("../../utils")
|
||||
const fetch = require("node-fetch")
|
||||
|
||||
/**
|
||||
* Common authentication logic for third parties. e.g. OAuth, OIDC.
|
||||
|
@ -65,7 +66,7 @@ exports.authenticateThirdParty = async function (
|
|||
}
|
||||
}
|
||||
|
||||
dbUser = syncUser(dbUser, thirdPartyUser)
|
||||
dbUser = await syncUser(dbUser, thirdPartyUser)
|
||||
|
||||
// create or sync the user
|
||||
const response = await db.post(dbUser)
|
||||
|
@ -86,10 +87,26 @@ exports.authenticateThirdParty = async function (
|
|||
return done(null, dbUser)
|
||||
}
|
||||
|
||||
async function syncProfilePicture(user, thirdPartyUser) {
|
||||
const pictureUrl = thirdPartyUser.profile._json.picture
|
||||
if (pictureUrl) {
|
||||
const response = await fetch(pictureUrl)
|
||||
|
||||
if (response.status === 200) {
|
||||
const type = response.headers.get("content-type")
|
||||
if (type.startsWith("image/")) {
|
||||
user.pictureUrl = pictureUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return user
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns a user that has been sync'd with third party information
|
||||
*/
|
||||
function syncUser(user, thirdPartyUser) {
|
||||
async function syncUser(user, thirdPartyUser) {
|
||||
// provider
|
||||
user.provider = thirdPartyUser.provider
|
||||
user.providerType = thirdPartyUser.providerType
|
||||
|
@ -112,6 +129,8 @@ function syncUser(user, thirdPartyUser) {
|
|||
}
|
||||
}
|
||||
|
||||
user = await syncProfilePicture(user, thirdPartyUser)
|
||||
|
||||
// profile
|
||||
user.thirdPartyProfile = {
|
||||
...profile._json,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/bbui",
|
||||
"description": "A UI solution used in the different Budibase projects.",
|
||||
"version": "0.9.87-alpha.1",
|
||||
"version": "0.9.87-alpha.3",
|
||||
"license": "AGPL-3.0",
|
||||
"svelte": "src/index.js",
|
||||
"module": "dist/bbui.es.js",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/builder",
|
||||
"version": "0.9.87-alpha.1",
|
||||
"version": "0.9.87-alpha.3",
|
||||
"license": "AGPL-3.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
@ -65,10 +65,10 @@
|
|||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "^0.9.87-alpha.1",
|
||||
"@budibase/client": "^0.9.87-alpha.1",
|
||||
"@budibase/bbui": "^0.9.87-alpha.3",
|
||||
"@budibase/client": "^0.9.87-alpha.3",
|
||||
"@budibase/colorpicker": "1.1.2",
|
||||
"@budibase/string-templates": "^0.9.87-alpha.1",
|
||||
"@budibase/string-templates": "^0.9.87-alpha.3",
|
||||
"@sentry/browser": "5.19.1",
|
||||
"@spectrum-css/page": "^3.0.1",
|
||||
"@spectrum-css/vars": "^3.0.1",
|
||||
|
|
|
@ -54,7 +54,11 @@
|
|||
</Layout>
|
||||
<ActionMenu align="right">
|
||||
<div slot="control" class="avatar">
|
||||
<Avatar size="M" initials={$auth.initials} />
|
||||
<Avatar
|
||||
size="M"
|
||||
initials={$auth.initials}
|
||||
url={$auth.user.pictureUrl}
|
||||
/>
|
||||
<Icon size="XL" name="ChevronDown" />
|
||||
</div>
|
||||
<MenuItem icon="UserEdit" on:click={() => userInfoModal.show()}>
|
||||
|
|
|
@ -100,7 +100,11 @@
|
|||
<div />
|
||||
<ActionMenu align="right">
|
||||
<div slot="control" class="avatar">
|
||||
<Avatar size="M" initials={$auth.initials} />
|
||||
<Avatar
|
||||
size="M"
|
||||
initials={$auth.initials}
|
||||
url={$auth.user.pictureUrl}
|
||||
/>
|
||||
<Icon size="XL" name="ChevronDown" />
|
||||
</div>
|
||||
<MenuItem icon="UserEdit" on:click={() => userInfoModal.show()}>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/cli",
|
||||
"version": "0.9.87-alpha.1",
|
||||
"version": "0.9.87-alpha.3",
|
||||
"description": "Budibase CLI, for developers, self hosting and migrations.",
|
||||
"main": "src/index.js",
|
||||
"bin": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/client",
|
||||
"version": "0.9.87-alpha.1",
|
||||
"version": "0.9.87-alpha.3",
|
||||
"license": "MPL-2.0",
|
||||
"module": "dist/budibase-client.js",
|
||||
"main": "dist/budibase-client.js",
|
||||
|
@ -18,9 +18,9 @@
|
|||
"dev:builder": "rollup -cw"
|
||||
},
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "^0.9.87-alpha.1",
|
||||
"@budibase/standard-components": "^0.9.87-alpha.1",
|
||||
"@budibase/string-templates": "^0.9.87-alpha.1",
|
||||
"@budibase/bbui": "^0.9.87-alpha.3",
|
||||
"@budibase/standard-components": "^0.9.87-alpha.3",
|
||||
"@budibase/string-templates": "^0.9.87-alpha.3",
|
||||
"regexparam": "^1.3.0",
|
||||
"shortid": "^2.2.15",
|
||||
"svelte-spa-router": "^3.0.5"
|
||||
|
|
|
@ -7,3 +7,4 @@ public/
|
|||
db/dev.db/
|
||||
dist
|
||||
coverage/
|
||||
watchtower-hook.json
|
|
@ -1,5 +1,10 @@
|
|||
FROM node:12-alpine
|
||||
|
||||
LABEL com.centurylinklabs.watchtower.lifecycle.pre-check="scripts/watchtower-hooks/pre-check.sh"
|
||||
LABEL com.centurylinklabs.watchtower.lifecycle.pre-update="scripts/watchtower-hooks/pre-update.sh"
|
||||
LABEL com.centurylinklabs.watchtower.lifecycle.post-update="scripts/watchtower-hooks/post-update.sh"
|
||||
LABEL com.centurylinklabs.watchtower.lifecycle.post-check="scripts/watchtower-hooks/post-check.sh"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV PORT=4001
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/server",
|
||||
"email": "hi@budibase.com",
|
||||
"version": "0.9.87-alpha.1",
|
||||
"version": "0.9.87-alpha.3",
|
||||
"description": "Budibase Web Server",
|
||||
"main": "src/index.js",
|
||||
"repository": {
|
||||
|
@ -60,9 +60,9 @@
|
|||
"author": "Budibase",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@budibase/auth": "^0.9.87-alpha.1",
|
||||
"@budibase/client": "^0.9.87-alpha.1",
|
||||
"@budibase/string-templates": "^0.9.87-alpha.1",
|
||||
"@budibase/auth": "^0.9.87-alpha.3",
|
||||
"@budibase/client": "^0.9.87-alpha.3",
|
||||
"@budibase/string-templates": "^0.9.87-alpha.3",
|
||||
"@elastic/elasticsearch": "7.10.0",
|
||||
"@koa/router": "8.0.0",
|
||||
"@sendgrid/mail": "7.1.1",
|
||||
|
@ -115,7 +115,7 @@
|
|||
"devDependencies": {
|
||||
"@babel/core": "^7.14.3",
|
||||
"@babel/preset-env": "^7.14.4",
|
||||
"@budibase/standard-components": "^0.9.87-alpha.1",
|
||||
"@budibase/standard-components": "^0.9.87-alpha.3",
|
||||
"@jest/test-sequencer": "^24.8.0",
|
||||
"@types/bull": "^3.15.1",
|
||||
"@types/jest": "^26.0.23",
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
echo '{ "current-hook" : "post-check" }' > 'watchtower-hook.json'
|
|
@ -0,0 +1 @@
|
|||
echo '{ "current-hook" : "post-update" }' > 'watchtower-hook.json'
|
|
@ -0,0 +1 @@
|
|||
echo '{ "current-hook" : "pre-check" }' > 'watchtower-hook.json'
|
|
@ -0,0 +1 @@
|
|||
echo '{ "current-hook" : "pre-update" }' > 'watchtower-hook.json'
|
|
@ -29,11 +29,11 @@
|
|||
"keywords": [
|
||||
"svelte"
|
||||
],
|
||||
"version": "0.9.87-alpha.1",
|
||||
"version": "0.9.87-alpha.3",
|
||||
"license": "MIT",
|
||||
"gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc",
|
||||
"dependencies": {
|
||||
"@budibase/bbui": "^0.9.87-alpha.1",
|
||||
"@budibase/bbui": "^0.9.87-alpha.3",
|
||||
"@spectrum-css/card": "^3.0.3",
|
||||
"@spectrum-css/link": "^3.1.3",
|
||||
"@spectrum-css/page": "^3.0.1",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@budibase/string-templates",
|
||||
"version": "0.9.87-alpha.1",
|
||||
"version": "0.9.87-alpha.3",
|
||||
"description": "Handlebars wrapper for Budibase templating.",
|
||||
"main": "src/index.cjs",
|
||||
"module": "dist/bundle.mjs",
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
node_modules/
|
||||
.env
|
||||
watchtower-hook.json
|
|
@ -1,5 +1,10 @@
|
|||
FROM node:12-alpine
|
||||
|
||||
LABEL com.centurylinklabs.watchtower.lifecycle.pre-check="scripts/watchtower-hooks/pre-check.sh"
|
||||
LABEL com.centurylinklabs.watchtower.lifecycle.pre-update="scripts/watchtower-hooks/pre-update.sh"
|
||||
LABEL com.centurylinklabs.watchtower.lifecycle.post-update="scripts/watchtower-hooks/post-update.sh"
|
||||
LABEL com.centurylinklabs.watchtower.lifecycle.post-check="scripts/watchtower-hooks/post-check.sh"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# copy files and install dependencies
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@budibase/worker",
|
||||
"email": "hi@budibase.com",
|
||||
"version": "0.9.87-alpha.1",
|
||||
"version": "0.9.87-alpha.3",
|
||||
"description": "Budibase background service",
|
||||
"main": "src/index.js",
|
||||
"repository": {
|
||||
|
@ -21,8 +21,8 @@
|
|||
"author": "Budibase",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@budibase/auth": "^0.9.87-alpha.1",
|
||||
"@budibase/string-templates": "^0.9.87-alpha.1",
|
||||
"@budibase/auth": "^0.9.87-alpha.3",
|
||||
"@budibase/string-templates": "^0.9.87-alpha.3",
|
||||
"@koa/router": "^8.0.0",
|
||||
"@techpass/passport-openidconnect": "^0.3.0",
|
||||
"aws-sdk": "^2.811.0",
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
echo '{ "current-hook" : "post-check" }' > 'watchtower-hook.json'
|
|
@ -0,0 +1 @@
|
|||
echo '{ "current-hook" : "post-update" }' > 'watchtower-hook.json'
|
|
@ -0,0 +1 @@
|
|||
echo '{ "current-hook" : "pre-check" }' > 'watchtower-hook.json'
|
|
@ -0,0 +1 @@
|
|||
echo '{ "current-hook" : "pre-update" }' > 'watchtower-hook.json'
|
Loading…
Reference in New Issue