Skip to content

Conversation

@Venefilyn
Copy link
Member

Allows us to use Basic authorize without base64-encoding ourselves
before using the command.

Signed-off-by: Freya Gustavsson [email protected]

Allows us to use Basic authorize without base64-encoding ourselves
before using the command.

Signed-off-by: Freya Gustavsson <[email protected]>
@Venefilyn Venefilyn added the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Dec 18, 2025
Copy link
Member

@allisonkarlitskaya allisonkarlitskaya left a comment

Choose a reason for hiding this comment

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

Thanks for this!

The --compact thing would be cool too!

"""Send a control message, build from **kwargs"""
self.json('', command=command, **kwargs)

def authorize(self, cookie: str, b64_content: str, auth_type: str = "Basic", **kwargs: Any) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

Probably make that just take the "response" as a single string instead of two strings stuck together?

Copy link
Member Author

@Venefilyn Venefilyn Dec 19, 2025

Choose a reason for hiding this comment

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

We can't use colon due to it being a limited character. Some parsing thing done in the main function

That's why I split it up

encoded_response = f"{auth_type} {b64_content}"
self.json('', command="authorize", cookie=cookie, response=encoded_response, **kwargs)

def basic(self, cookie: str, user: str, password: str, **kwargs: Any) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

I'd also take the user:pass as a single string that the user is expected to provide their own : for. I feel less strongly about this one, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation no-test For doc/workflow changes, or experiments which don't need a full CI run,

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants