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

feat: client intialized with ticket and CSRF prevention Token #373

Merged
merged 3 commits into from
Nov 24, 2024

Conversation

camaeel
Copy link
Contributor

@camaeel camaeel commented Nov 8, 2024

Client intialized with ticket and CSRF prevention Token.

Completes #370

@Tinyblargon Tinyblargon added the type/enhancement An improvement of existing functionality label Nov 8, 2024
@camaeel
Copy link
Contributor Author

camaeel commented Nov 23, 2024

@Tinyblargon any chance for a review and merge for this tiny PR?

Copy link
Collaborator

@Tinyblargon Tinyblargon left a comment

Choose a reason for hiding this comment

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

Could you make the 2 minor changes?
Everything else looks good.

Sorry, thought I had finished the code review already.

@@ -131,6 +131,10 @@ func (c *Client) SetAPIToken(userID, token string) {
c.session.SetAPIToken(userID, token)
}

func (c *Client) SetTicket(ticket, csrfPreventionToken string) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add a comment to this?
Just a notice that it is different from the normal login/api authentication methods and what it is used for.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed

@@ -167,6 +167,11 @@ func (s *Session) SetAPIToken(userID, token string) {
s.AuthToken = auth
}

func (s *Session) SetTicket(ticket, csrfPreventionToken string) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you make this private so setTicket? Nothing in Session should be exposed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

func (Session)setTicket made private

@Tinyblargon Tinyblargon merged commit ea532c4 into Telmate:master Nov 24, 2024
5 checks passed
@camaeel
Copy link
Contributor Author

camaeel commented Nov 24, 2024

Thanx @Tinyblargon

@Tinyblargon Tinyblargon added type/feature Completely new functionality. size/S Denotes a PR that changes 10-29 lines, ignoring generated files and removed type/enhancement An improvement of existing functionality labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Denotes a PR that changes 10-29 lines, ignoring generated files type/feature Completely new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants