Skip to content

Commit

Permalink
fix(jans-cli): retain scim client in config.ini (#872)
Browse files Browse the repository at this point in the history
  • Loading branch information
devrimyatar authored Feb 21, 2022
1 parent 0b96acd commit 8346517
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
14 changes: 7 additions & 7 deletions jans-cli/cli/config_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
config = configparser.ConfigParser()

host = os.environ.get('jans_host')
client_id = os.environ.get(my_op_mode + '_client_id')
client_secret = os.environ.get(my_op_mode + '_client_secret')
client_id = os.environ.get(my_op_mode + 'jca_client_id')
client_secret = os.environ.get(my_op_mode + 'jca_client_secret')
debug = os.environ.get('jans_client_debug')
debug_log_file = os.environ.get('jans_debug_log_file')
error_log_file = os.path.join(cur_dir, 'error.log')
Expand Down Expand Up @@ -137,11 +137,11 @@ def join(self):
if config_ini_fn.exists():
config.read_string(config_ini_fn.read_text())
host = config['DEFAULT']['jans_host']
client_id = config['DEFAULT'][my_op_mode + '_client_id']
if config['DEFAULT'].get(my_op_mode + '_client_secret'):
client_secret = config['DEFAULT'][my_op_mode + '_client_secret']
elif config['DEFAULT'].get(my_op_mode + '_client_secret_enc'):
client_secret_enc = config['DEFAULT'][my_op_mode + '_client_secret_enc']
client_id = config['DEFAULT']['jca_client_id']
if config['DEFAULT'].get('jca_client_secret'):
client_secret = config['DEFAULT']['jca_client_secret']
elif config['DEFAULT'].get('jca_client_secret_enc'):
client_secret_enc = config['DEFAULT']['jca_client_secret_enc']
client_secret = encode_decode(client_secret_enc, decode=True)
debug = config['DEFAULT'].get('debug')
debug_log_file = config['DEFAULT'].get('debug_log_file')
Expand Down
5 changes: 3 additions & 2 deletions jans-linux-setup/jans_setup/setup_app/installers/jans_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ def configure(self, options={}):
config['DEFAULT']['jca_client_secret_enc'] = Config.role_based_client_encoded_pw

if Config.get('installScimServer'):
config['DEFAULT']['scim_client_id'] = Config.role_based_client_id
config['DEFAULT']['scim_client_secret_enc'] = Config.role_based_client_encoded_pw
config['DEFAULT']['scim_client_id'] = Config.scim_client_id
config['DEFAULT']['scim_client_secret_enc'] = Config.scim_client_encoded_pw

config.write(self.config_ini_fn.open('w'))
self.config_ini_fn.chmod(0o600)


def render_import_templates(self):
Expand Down

0 comments on commit 8346517

Please sign in to comment.