Skip to content

Commit

Permalink
wip fix default ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Oct 15, 2019
1 parent a083e14 commit 87aa6f0
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 33 deletions.
8 changes: 4 additions & 4 deletions cli/introspection/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "@prisma/introspection",
"version": "0.0.84",
"version": "0.0.87",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "Apache-2.0",
"repository": "git@github.com:prisma/prisma2.git",
"author": "Tim Suchanek <suchanek@prisma.io>",
"devDependencies": {
"@prisma/cli": "^0.1.11",
"@prisma/cli": "^0.1.12",
"@prisma/generator-helper": "^0.0.13",
"@prisma/lift": "^0.3.42",
"@prisma/photon": "^0.2.113",
"@prisma/lift": "^0.3.43",
"@prisma/photon": "^0.2.114",
"@prisma/sdk": "^0.0.20",
"@types/debug": "^4.1.5",
"@types/dotenv": "^6.1.1",
Expand Down
9 changes: 9 additions & 0 deletions cli/introspection/src/prompt/components/useConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { isdlToDatamodel2 } from '@prisma/sdk'
import { DataSource } from '@prisma/generator-helper'
import { credentialsToUri, databaseTypeToConnectorType } from '../../convertCredentials'
import { TabIndexContext } from '@prisma/ink-components'
import { canConnectToDatabase } from '@prisma/lift'

type ConnectorState = {
error: string | null
Expand Down Expand Up @@ -92,6 +93,14 @@ export function useConnector() {
try {
tabContext.lockNavigation(true)
setState({ connecting: true })

const canRustConnect = await canConnectToDatabase(credentials.uri!)

if (canRustConnect.status === 'TlsError') {
const delimiter = credentials.uri!.includes('?') ? '&' : '?'
credentials.uri += delimiter + 'sslaccept=accept_invalid_certs'
}

const connectorAndDisconnect = await getConnectedConnectorFromCredentials(credentials)
connector = connectorAndDisconnect
await getMetadata()
Expand Down
29 changes: 19 additions & 10 deletions cli/introspection/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,16 @@
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b"
integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==

"@prisma/cli@0.1.11", "@prisma/cli@^0.1.11":
"@prisma/cli@0.1.12", "@prisma/cli@^0.1.12":
version "0.1.12"
resolved "https://registry.yarnpkg.com/@prisma/cli/-/cli-0.1.12.tgz#0cdc93cca16f897056e55f8aaf88390de0fdaaa6"
integrity sha512-qkfNge7QWT4c1dVPGPK3CI9IWrYEK8sJ6eALiSCt7kUYnnOdJkbRbjQzfcSkvoE+PqFlVPZjwo0x1dTg7vRgHw==
dependencies:
arg "^4.1.0"
chalk "^2.4.2"
strip-indent "^3.0.0"

"@prisma/cli@^0.1.11":
version "0.1.11"
resolved "https://registry.yarnpkg.com/@prisma/cli/-/cli-0.1.11.tgz#0a812596088cb710432d76aeb18afd6c118eccac"
integrity sha512-9HgpQgsVnaldYl38cl43rC1wkcHXvnmGff5lvG4t1GeppJFVwikY/kRNPgj0oiudkyUlcsxEjLyH8cK6JcNIVg==
Expand Down Expand Up @@ -425,10 +434,10 @@
strip-indent "^3.0.0"
terminal-link "^2.0.0"

"@prisma/lift@^0.3.42":
version "0.3.42"
resolved "https://registry.yarnpkg.com/@prisma/lift/-/lift-0.3.42.tgz#2a5268c741bf8aa11590da94caecdf387616304d"
integrity sha512-LvIvvIcaZ5eKB4b3sNhzVd/1UVT0nDuL01cQz3NwZuQlyQss0d5O/d7CiqNh/ZMwxiCaStYKO1dAEPmxcQ7qaQ==
"@prisma/lift@^0.3.43":
version "0.3.43"
resolved "https://registry.yarnpkg.com/@prisma/lift/-/lift-0.3.43.tgz#381cd40fe7c3c8dc87bad8f952e892a9aace893c"
integrity sha512-tdIYjVPK6ogdArQ9rAg3emKZGEP+Eixr3GH8elXVaWlSFl9rv1BiPKeDsrolBkZ9R0SMBuiiNuLB1Aenv1Z6mg==
dependencies:
"@prisma/fetch-engine" "^0.3.2"
"@prisma/get-platform" "^0.1.1"
Expand Down Expand Up @@ -469,13 +478,13 @@
strip-indent "^3.0.0"
supports-hyperlinks "^1.0.1"

"@prisma/photon@^0.2.113":
version "0.2.113"
resolved "https://registry.yarnpkg.com/@prisma/photon/-/photon-0.2.113.tgz#057127cd93818458380cbee127f90aa28cee86c8"
integrity sha512-rtvE3TaWmtewgOt9Vf2CkOYR4zUd0nQ7JuNr3fi8Auvfvfs3Nn67x6JlOHpQ9D4ZFTiCokH346Pu2AJ1uw5CHQ==
"@prisma/photon@^0.2.114":
version "0.2.114"
resolved "https://registry.yarnpkg.com/@prisma/photon/-/photon-0.2.114.tgz#ed51f64c1aaf4e30d4a18b2d00eef459e3eab929"
integrity sha512-rAOGo3rX8vm8qLbDYx8wRmSk7QfJylMdIl+uXst8S0nsSWajjzERgmgLQ6FkTQnUUmd3ZjtWX4MqEeFj/2A2rg==
dependencies:
"@apexearth/copy" "^1.4.2"
"@prisma/cli" "0.1.11"
"@prisma/cli" "0.1.12"
"@prisma/engine-core" "0.0.98"
"@prisma/fetch-engine" "^0.3.4"
"@prisma/generator-helper" "^0.0.13"
Expand Down
10 changes: 5 additions & 5 deletions cli/prisma2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"version": "f8e6f742d28e0e2672a005c34996b9a040c99ea9"
},
"devDependencies": {
"@prisma/cli": "^0.1.11",
"@prisma/cli": "^0.1.12",
"@prisma/fetch-engine": "^0.3.4",
"@prisma/generator-helper": "^0.0.13",
"@prisma/introspection": "0.0.84",
"@prisma/lift": "0.3.42",
"@prisma/photon": "^0.2.113",
"@prisma/introspection": "0.0.87",
"@prisma/lift": "0.3.43",
"@prisma/photon": "^0.2.114",
"@prisma/sdk": "^0.0.20",
"@prisma/studio-transports": "^0.124.0",
"@sentry/node": "5",
Expand Down Expand Up @@ -68,4 +68,4 @@
"**/**/prisma-datamodel": "1.36.0-alpha.8",
"**/**/**/prisma-datamodel": "1.36.0-alpha.8"
}
}
}
37 changes: 23 additions & 14 deletions cli/prisma2/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,16 @@
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b"
integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==

"@prisma/cli@0.1.11", "@prisma/cli@^0.1.11":
"@prisma/cli@0.1.12", "@prisma/cli@^0.1.12":
version "0.1.12"
resolved "https://registry.yarnpkg.com/@prisma/cli/-/cli-0.1.12.tgz#0cdc93cca16f897056e55f8aaf88390de0fdaaa6"
integrity sha512-qkfNge7QWT4c1dVPGPK3CI9IWrYEK8sJ6eALiSCt7kUYnnOdJkbRbjQzfcSkvoE+PqFlVPZjwo0x1dTg7vRgHw==
dependencies:
arg "^4.1.0"
chalk "^2.4.2"
strip-indent "^3.0.0"

"@prisma/cli@^0.1.11":
version "0.1.11"
resolved "https://registry.yarnpkg.com/@prisma/cli/-/cli-0.1.11.tgz#0a812596088cb710432d76aeb18afd6c118eccac"
integrity sha512-9HgpQgsVnaldYl38cl43rC1wkcHXvnmGff5lvG4t1GeppJFVwikY/kRNPgj0oiudkyUlcsxEjLyH8cK6JcNIVg==
Expand Down Expand Up @@ -419,10 +428,10 @@
strip-indent "^3.0.0"
terminal-link "^2.0.0"

"@prisma/introspection@0.0.84":
version "0.0.84"
resolved "https://registry.yarnpkg.com/@prisma/introspection/-/introspection-0.0.84.tgz#84cb7f93b55f206c087ed16b6bf645ac976a99bf"
integrity sha512-5k6/JxFgwBNOrSSv0HBONvtpp89RuMYZGVHcGgF2sqgq1+U9GYM59xPM7b3yE34s4xVpe/P6xj9wIXpETx5rRQ==
"@prisma/introspection@0.0.87":
version "0.0.87"
resolved "https://registry.yarnpkg.com/@prisma/introspection/-/introspection-0.0.87.tgz#2bdfde1fc3a02ebd95357ef1681af7fcc9fc95eb"
integrity sha512-vHK6Z7/d0Q7zeoxsYmliqBmY59Oxs97LkunvPck8u4QDtifRnxsm0c17KNcBzk0O5Nh5WEhWYZdY2Z4E2Xbumw==
dependencies:
"@prisma/fetch-engine" "^0.3.4"
"@prisma/ink-components" "^0.0.7"
Expand All @@ -449,10 +458,10 @@
tar "^4.4.10"
terminal-link "^2.0.0"

"@prisma/lift@0.3.42":
version "0.3.42"
resolved "https://registry.yarnpkg.com/@prisma/lift/-/lift-0.3.42.tgz#2a5268c741bf8aa11590da94caecdf387616304d"
integrity sha512-LvIvvIcaZ5eKB4b3sNhzVd/1UVT0nDuL01cQz3NwZuQlyQss0d5O/d7CiqNh/ZMwxiCaStYKO1dAEPmxcQ7qaQ==
"@prisma/lift@0.3.43":
version "0.3.43"
resolved "https://registry.yarnpkg.com/@prisma/lift/-/lift-0.3.43.tgz#381cd40fe7c3c8dc87bad8f952e892a9aace893c"
integrity sha512-tdIYjVPK6ogdArQ9rAg3emKZGEP+Eixr3GH8elXVaWlSFl9rv1BiPKeDsrolBkZ9R0SMBuiiNuLB1Aenv1Z6mg==
dependencies:
"@prisma/fetch-engine" "^0.3.2"
"@prisma/get-platform" "^0.1.1"
Expand Down Expand Up @@ -493,13 +502,13 @@
strip-indent "^3.0.0"
supports-hyperlinks "^1.0.1"

"@prisma/photon@^0.2.113":
version "0.2.113"
resolved "https://registry.yarnpkg.com/@prisma/photon/-/photon-0.2.113.tgz#057127cd93818458380cbee127f90aa28cee86c8"
integrity sha512-rtvE3TaWmtewgOt9Vf2CkOYR4zUd0nQ7JuNr3fi8Auvfvfs3Nn67x6JlOHpQ9D4ZFTiCokH346Pu2AJ1uw5CHQ==
"@prisma/photon@^0.2.114":
version "0.2.114"
resolved "https://registry.yarnpkg.com/@prisma/photon/-/photon-0.2.114.tgz#ed51f64c1aaf4e30d4a18b2d00eef459e3eab929"
integrity sha512-rAOGo3rX8vm8qLbDYx8wRmSk7QfJylMdIl+uXst8S0nsSWajjzERgmgLQ6FkTQnUUmd3ZjtWX4MqEeFj/2A2rg==
dependencies:
"@apexearth/copy" "^1.4.2"
"@prisma/cli" "0.1.11"
"@prisma/cli" "0.1.12"
"@prisma/engine-core" "0.0.98"
"@prisma/fetch-engine" "^0.3.4"
"@prisma/generator-helper" "^0.0.13"
Expand Down

0 comments on commit 87aa6f0

Please sign in to comment.