Skip to content

Conversation

@jharris4
Copy link
Contributor

also change local defaults for community edition

also change local defaults for community edition
@jharris4 jharris4 requested a review from OskarDamkjaer May 26, 2021 13:48
'browser.remote_content_hostname_allowlist': 'guides.neo4j.com, localhost',
'browser.retain_connection_credentials': false
'browser.retain_connection_credentials': false,
'browser.retain_editor_history': false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not make sense to default this to true?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As that's the current behaviour?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth noting that the !isEnterprise stuff defaults to true since edition default/before connect is null

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it's better to explicitly look for "community" rather than not enterprise?

Copy link
Contributor Author

@jharris4 jharris4 May 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The server does default this setting to true, but for safety it was decided to default to false on the client side.

The settings are only ever loaded after initial discovery is done, so by that point we know the version/edition.

Also, only enterprise supports the setting, so that's why I decided to code it as "not enterprise"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Canny and Sentry both check allow shouldAllowOutgoing connections before connecting

* Helpers
*/

export const VERSION_FOR_EDITOR_HISTORY_SETTING = '4.3.0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need to be exported

isEnterprise(state) && versionHasEditorHistorySetting(getVersion(state))

export const shouldAllowOutgoingConnections = (state: any) =>
!isEnterprise(state) || getAllowOutgoingConnections(state)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would send outgoing connections before we connect to a database? I think that's a no-go in airgapped deployments

export const shouldRetainConnectionCredentials = (state: any) =>
!isEnterprise(state) || getRetainConnectionCredentials(state)

export const shouldRetainEditorHistory = (state: any) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a nit but could we move this to by be the other history getters? (so to line 146). Feel free to disregard this comment, just find it slightly more readable

Copy link
Contributor

@OskarDamkjaer OskarDamkjaer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I the current impl would do outgoing connections before connecting

Copy link
Contributor

@OskarDamkjaer OskarDamkjaer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There might be more places where we want to check hasEdition before checking isEnterprise in the future, this looks good for the release

@jharris4 jharris4 merged commit e860776 into neo4j:release-4.3.0 May 31, 2021
@jharris4 jharris4 changed the title add support for browser.retain_editor_history setting Add support for browser.retain_editor_history setting Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants