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

Add diskutil package for Atomic File Writing Operations #187

Merged
merged 2 commits into from
Jun 1, 2023

Conversation

maxlambrecht
Copy link
Contributor

Pull request check list

  • Proper tests/regressions included?
  • Documentation updated?

Affected functionality

Description of change

This PR introduces the new diskutil package which provides an utility function for performing atomic file write operation using private file mode. This function is essential for ensuring the integrity and consistency of data when writing to disk:

  • AtomicWritePrivateFile(path string, data []byte): This function performs an atomic write operation to a file with private file mode permissions (0600). It handles the process of writing to a temporary file and then renaming it to the intended file path.

Changes the "disk" KeyManager to use the AtomicWritePrivateFile function for writing keys to disk.

Changes GaladrielClient JWT Token Saving: The function for saving JWT tokens in the GaladrielClient has also been updated to use the AtomicWritePrivateFile function.

Which issue this pull requests fixes

Signed-off-by: Max Lambrecht <maxlambrecht@gmail.com>
@sonarcloud
Copy link

sonarcloud bot commented May 31, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@maxlambrecht maxlambrecht merged commit e957f82 into HewlettPackard:main Jun 1, 2023
@maxlambrecht maxlambrecht deleted the diskutil-package branch June 1, 2023 14:30
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.

3 participants