Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support allow-unauthorized in aem up #2352

Merged
merged 7 commits into from
May 3, 2024
Merged

Conversation

dominique-pfister
Copy link
Contributor

fix #2351

@dominique-pfister
Copy link
Contributor Author

There are more invocations of getFetch() in the code, hope this is the only one to fix for this issue.

Copy link
Contributor

@tripodsan tripodsan left a comment

Choose a reason for hiding this comment

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

that's not enough.... search for all getFetch() calls :-)

Copy link

github-actions bot commented May 2, 2024

This PR will trigger a patch release when merged.

src/up.js Outdated
@@ -92,6 +92,12 @@ export default function up() {
type: 'string',
})
.group(['url', 'livereload', 'no-livereload', 'open', 'no-open', 'print-index', 'cache'], 'AEM Options')
.option('allow-unauthorized', {
alias: 'allowUnauthorized',
describe: 'Whether to allow unauthorized access to server',
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe this is not a very good description... I think allowInsecure would be better

@@ -116,7 +116,7 @@ export class BaseServer extends EventEmitter {
let retries = 1;
if (this._project.kill && await utils.checkPortInUse(this._port, this._addr)) {
try {
const res = await getFetch()(`${this._scheme}://${this._addr}:${this._port}/.kill`);
const res = await getFetch(this._project.allowInsecure)(`${this._scheme}://${this._addr}:${this._port}/.kill`);
Copy link
Contributor

Choose a reason for hiding this comment

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

this is a request back to localhost, so if https, it most probably is a self-signed, to I would use true by default

Copy link
Contributor

@tripodsan tripodsan left a comment

Choose a reason for hiding this comment

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

we should probably also add it here:
https://github.com/adobe/helix-cli/blob/ef79a85031259d242919baafd16b28a19a06aa46/src/server/HelixImportServer.js#L104C23-L104C29

IIRC, this was added because some imported sites had invalid certs, but I don't think this should be the default.

@kptdobe WDYT?

@kptdobe
Copy link
Contributor

kptdobe commented May 2, 2024

rejectUnauthorized: false was introduced by #2040 in the importer server.
To use the same logic than for aem up, true can be the default and the option would allow to disable it.

So yes, I agree we should harmonize the 2 servers and corresponding option handling.

Comment on lines +95 to +100
.option('allow-insecure', {
alias: 'allowInsecure',
describe: 'Whether to allow insecure requests to the server',
type: 'boolean',
default: false,
})
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe also add this to import.js ?

@dominique-pfister dominique-pfister merged commit e5cdac0 into main May 3, 2024
9 checks passed
@dominique-pfister dominique-pfister deleted the issue-2351 branch May 3, 2024 08:23
tripodsan pushed a commit that referenced this pull request May 3, 2024
## [16.3.11](v16.3.10...v16.3.11) (2024-05-03)

### Bug Fixes

* support allow-unauthorized in aem up ([#2352](#2352)) ([e5cdac0](e5cdac0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Could add a Options named '--allowUnauthorized ' in command?
3 participants