-
Notifications
You must be signed in to change notification settings - Fork 111
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
[APP-7307]: Remove logo file path manipulation in CLI for OrganizationSetLogo. #4651
Conversation
…side handler anyway).
Validated it works:
|
@@ -345,15 +344,7 @@ func (c *viamClient) organizationLogoSetAction(cCtx *cli.Context, orgID, logoFil | |||
if err := c.ensureLoggedIn(); err != nil { | |||
return err | |||
} | |||
|
|||
// determine whether this is a valid file path on the local system | |||
logoFilePath = strings.ToLower(filepath.Clean(logoFilePath)) |
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 we keep the filepath.Clean?
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.
Yes
cli/client.go
Outdated
} | ||
|
||
logoFile, err := os.Open(logoFilePath) | ||
logoFile, err := os.Open(logoFilePath) //nolint:gosec |
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.
what is the linter complaining about for security
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.
If I add filepath.Clean
maybe it won't be necessary - but yeah really didn't know what / why needed
if len(logoFilePath) < 5 || logoFilePath[len(logoFilePath)-4:] != ".png" { | ||
return errors.Errorf("%s is not a valid .png file path", logoFilePath) |
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.
why remove? because it might be a png but not have png ending?
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.
we do this checking server side so agree we dont necessarily need it here
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.
Duplicated validation thats not as thorough as what we have in the BE because of that reason
https://viam.atlassian.net/browse/APP-7307