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

Make the file reader utility aware of BOMs #1045

Merged
merged 5 commits into from Oct 25, 2023
Merged

Conversation

hslatman
Copy link
Member

@hslatman hslatman commented Oct 23, 2023

Fixes #1042

Made the CLI file reader utility aware of the BOM, and skip it. The code was copied from https://github.com/dimchansky/utfbom.

It might be an option to move this to the https://github.com/smallstep/cli-utils repo and implement this in the fileutil package.

In addition to the BOM, this PR also improves the error messages returned a bit by escaping the file name, and prevents index out of range errors when no PEM blocks are detected in a file.

@github-actions github-actions bot added the needs triage Waiting for discussion / prioritization by team label Oct 23, 2023
@hslatman
Copy link
Member Author

@dopey know what's up with that action linter: https://github.com/smallstep/cli/actions/runs/6613903057/job/17962699907?pr=1045?

@hslatman hslatman requested a review from maraino October 23, 2023 13:25
@hslatman hslatman added this to the v0.25.1 milestone Oct 24, 2023
Copy link
Collaborator

@maraino maraino left a comment

Choose a reason for hiding this comment

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

lgtm, but let's move this to an internal package.

@hslatman hslatman requested a review from maraino October 24, 2023 22:08
@hslatman hslatman merged commit e397d84 into master Oct 25, 2023
15 checks passed
@hslatman hslatman deleted the herman/ignore-bom branch October 25, 2023 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Step CLI panics when inspecting improperly encoded certificate
2 participants