AtlassianPS / JiraPS

PowerShell module to interact with Atlassian JIRA
https://AtlassianPS.org/module/JiraPS
MIT License
322 stars 131 forks source link

Changed ConfigServer to be in module's scope #370

Closed lipkau closed 4 years ago

lipkau commented 4 years ago

Description

Have Set-JiraConfigServer store the server in the module's session instead of in a file.

Motivation and Context

Several issues were raised asking for help because the config.xml could not be written (or changed)

Types of changes

Checklist

sstodd7532 commented 4 years ago

What about saving a config file to the user profile? Or something like this? $env:USERPROFILE\JiraPS\Config.xml

Dejulia489 commented 4 years ago

Removing persistent sessions feels like a step backwards. I agree with @sstodd7532, why not store it in the user profile or in a module\user specific folder in app data roaming. The password is encrypted on disk so a centralized location for a session file shouldn't be a security risk. This will also provide session persistence through module upgrades, which is another issue I have with how sessions are handled currently.

lipkau commented 4 years ago

fair point.

@Dejulia489 : it's not the session which is stored. only the address of the server. storing the session is not part of this PR

and I don't know how you think this would be encrypted

Dejulia489 commented 4 years ago

That’s right you aren’t storing credentials along with the server Config. I think that should be addressed as well. Regardless of what is stored, it can be moved to $env:appdata to resolve this issue without removing functionality. It will also add functionality by persisting through module upgrades.

Edit: Removed spacing in AppData

lipkau commented 4 years ago

$env:appdata only exists in windows. But I found a work-around