feat(auth): add connectors v3 as an app (#5751)
This commit is contained in:
@@ -21,7 +21,8 @@ export enum DefaultAppIds {
|
||||
SpeckleConnectorsDUI = 'sdui',
|
||||
Excel = 'spklexcel',
|
||||
PowerBI = 'spklpwerbi',
|
||||
Automate = 'spklautoma'
|
||||
Automate = 'spklautoma',
|
||||
ConnectorsV3 = 'connectrV3'
|
||||
}
|
||||
|
||||
const SpeckleWebApp = {
|
||||
@@ -86,6 +87,25 @@ const SpeckleConnectorsDUI = {
|
||||
]
|
||||
}
|
||||
|
||||
const SpeckleConnectorsV3 = {
|
||||
id: DefaultAppIds.ConnectorsV3,
|
||||
secret: DefaultAppIds.ConnectorsV3,
|
||||
name: 'Desktop Connectors',
|
||||
description: 'Speckle V3 connectors..',
|
||||
trustByDefault: false, // NOTE: we do not wanna automatically authenticate in DUI because it uses cached account before which we wanna switch account. trustByDefault: true skips this step
|
||||
public: true,
|
||||
redirectUrl: 'http://localhost:29355',
|
||||
scopes: [
|
||||
Scopes.Streams.Read,
|
||||
Scopes.Streams.Write,
|
||||
Scopes.Profile.Read,
|
||||
Scopes.Profile.Email,
|
||||
Scopes.Users.Read,
|
||||
Scopes.Users.Invite,
|
||||
...workspaceScopes
|
||||
]
|
||||
}
|
||||
|
||||
const SpeckleConnectorApp = {
|
||||
id: DefaultAppIds.Connector,
|
||||
secret: DefaultAppIds.Connector,
|
||||
@@ -193,7 +213,8 @@ const defaultApps = [
|
||||
SpeckleDesktopAuthService,
|
||||
SpeckleExcel,
|
||||
SpecklePowerBi,
|
||||
SpeckleAutomate
|
||||
SpeckleAutomate,
|
||||
SpeckleConnectorsV3
|
||||
]
|
||||
|
||||
export function getDefaultApps() {
|
||||
|
||||
@@ -170,7 +170,7 @@ describe('GraphQL @apps-api', () => {
|
||||
expect(res).to.be.json
|
||||
expect(res.body.errors).to.not.exist
|
||||
expect(res.body.data.apps).to.be.an('array')
|
||||
expect(res.body.data.apps.length).to.equal(10)
|
||||
expect(res.body.data.apps.length).to.equal(11)
|
||||
})
|
||||
|
||||
it('Should get app info without secret if not authenticated and owner', async () => {
|
||||
|
||||
@@ -139,7 +139,7 @@ describe('Services @apps-services', () => {
|
||||
it('Should get all the public apps on this server', async () => {
|
||||
const apps = await getAllPublicApps()
|
||||
expect(apps).to.be.an('array')
|
||||
expect(apps.length).to.equal(10)
|
||||
expect(apps.length).to.equal(11)
|
||||
})
|
||||
|
||||
it('Should fail to register an app with no scopes', async () => {
|
||||
|
||||
Reference in New Issue
Block a user