Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

LISK_API_PUBLIC=false does not work #4631

Closed
fchavant opened this issue Dec 17, 2019 · 1 comment
Closed

LISK_API_PUBLIC=false does not work #4631

fchavant opened this issue Dec 17, 2019 · 1 comment
Assignees
Milestone

Comments

@fchavant
Copy link
Contributor

Expected behavior

Public API can be disabled by setting LISK_API_PUBLIC=false when LISK_NETWORK=devnet.

Actual behavior

LISK_API_PUBLIC=false does not seem to work with LISK_NETWORK=devnet.

Steps to reproduce

LISK_NETWORK=devnet node scripts/generate_config.js -c config.json |jq .modules.http_api.access.public
true
LISK_NETWORK=devnet LISK_API_PUBLIC=false node scripts/generate_config.js -c config.json |jq .modules.http_api.access.public
true

Which version(s) does this affect? (Environment, OS, etc...)

>=2.0

@nazarhussain
Copy link
Contributor

Confirmed its because of this validation logic,

https://github.com/LiskHQ/lisk-sdk/blob/090e5a011ecaff59034da6b66ff7ae0e19474b0d/framework/src/controller/validator/keywords/env/index.js#L58

if (variableValue) {

This never triggered in case of false value. Rather it should be:

if (variableValue != undefined) {

@ManuGowda ManuGowda transferred this issue from another repository Dec 18, 2019
@ManuGowda ManuGowda added this to the Sprint 11 milestone Dec 18, 2019
@nazarhussain nazarhussain changed the title LISK_API_PUBLIC=false does not work with LISK_NETWORK=devnet LISK_API_PUBLIC=false does not work Dec 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants