-
Notifications
You must be signed in to change notification settings - Fork 241
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
Conversation
@Tinyblargon any chance for a review and merge for this tiny PR? |
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
proxmox/session.go
Outdated
@@ -167,6 +167,11 @@ func (s *Session) SetAPIToken(userID, token string) { | |||
s.AuthToken = auth | |||
} | |||
|
|||
func (s *Session) SetTicket(ticket, csrfPreventionToken string) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Thanx @Tinyblargon |
Client intialized with ticket and CSRF prevention Token.
Completes #370