Skip to content

Commit

Permalink
fix(enterprise): validate domain as URI
Browse files Browse the repository at this point in the history
This prevents the user from accidentally using an invalid URI for the
`domain` field (e.g. a domain that's missing the protocol prefix).
  • Loading branch information
thsig authored and eysi09 committed Aug 12, 2020
1 parent 36865bc commit 85ae9ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion garden-service/src/config/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,9 @@ export const projectDocsSchema = () =>
// TODO: Refer to enterprise documentation for more details.
domain: joi
.string()
.uri()
.meta({ internal: true })
.description("The domain to use for cloud features. Should point to the API/backend base URL."),
.description("The domain to use for cloud features. Should be the full API/backend URL."),
// Note: We provide a different schema below for actual validation, but need to define it this way for docs
// because joi.alternatives() isn't handled well in the doc generation.
environments: joi
Expand Down
2 changes: 1 addition & 1 deletion garden-service/test/unit/src/commands/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function makeCommandParams(garden: TestGarden) {
describe("LoginCommand", () => {
let tmpDir: tmp.DirectoryResult
let projectConfig: ProjectConfig
const dummyDomain = "dummy-domain"
const dummyDomain = "http://dummy-domain.com"

before(async () => {
tmpDir = await tmp.dir({ unsafeCleanup: true })
Expand Down

0 comments on commit 85ae9ee

Please sign in to comment.