Skip to content

Accept \n line ending in token file #72

@fkjensen

Description

@fkjensen

Using humioctl 0.28.2 I see that '\n' is not accepted as a line ending for the token file. For usability reasons it can be a nice idea.

Works

bin/humioctl -u darkstar.evilcorp.com groups list
...

End of line feature for \n

echo "********************************************" > ~/.humio/darkstar.token
bin/humioctl -u darkstar.evilcorp.com groups list
bin/humioctl --token-file ~/.humio/darkstar.token -u darkstar.evilcorp.com groups list
error listing groups: Post "https://darkstar.evilcorp.com/graphql": net/http: invalid header field value "Bearer ********************************************\n" for key Authorization

Fix by removing '\n' at the end of the token file

truncate -s -1 ~/.humio/darkstar.token

Works with truncated token file

bin/humioctl --token-file ~/.humio/darkstar.token -u darkstar.evilcorp.com groups list
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions