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

Changed ConfigServer to be in module's scope #370

Merged
merged 2 commits into from
Aug 15, 2019

Conversation

lipkau
Copy link
Member

@lipkau lipkau commented Aug 15, 2019

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • I have added Pester Tests that describe what my changes should do.
  • I have updated the documentation accordingly.

@sstodd7532
Copy link

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

@Dejulia489
Copy link
Contributor

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
Copy link
Member Author

lipkau commented Aug 15, 2019

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
Copy link
Contributor

Dejulia489 commented Aug 15, 2019

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
Copy link
Member Author

lipkau commented Aug 15, 2019

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

Copy link
Contributor

@brianbunke brianbunke left a comment

Choose a reason for hiding this comment

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

[Environment]::GetFolderPath('ApplicationData') is the cross-platform solution.

No more breaking change, LGTM :shipit:

@lipkau lipkau merged commit 2e1643f into AtlassianPS:develop Aug 15, 2019
@lipkau lipkau deleted the fix/haveConfigNotInFile branch August 15, 2019 21:20
@lipkau lipkau added this to the v2.11 milestone Aug 15, 2019
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.

4 participants