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

[CHAT-1471] Allowed/blocked file extensions and content types #582

Merged
merged 11 commits into from
Jan 25, 2021

Conversation

miagilepner
Copy link
Contributor

Submit a pull request

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

@github-actions
Copy link
Contributor

github-actions bot commented Jan 12, 2021

Size Change: 0 B

Total Size: 214 kB

ℹ️ View Unchanged
Filename Size Change
dist/browser.es.js 45.9 kB 0 B
dist/browser.full-bundle.min.js 29.6 kB 0 B
dist/browser.js 46.5 kB 0 B
dist/index.es.js 45.9 kB 0 B
dist/index.js 46.5 kB 0 B

compressed-size-action

src/types.ts Outdated
@@ -1251,12 +1253,24 @@ export type AppSettings = {
disable_auth_checks?: boolean;
disable_permissions_checks?: boolean;
enforce_unique_usernames?: 'no' | 'app' | 'team';
file_upload_config?: {
allowed_file_extensions?: string[];
allowed_mime_types?: string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to confirm, do we have some exhaustive list of all these types/extensions? @miagilepner

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't. We could make an exhaustive list (e.g. for the media types the full list is here: https://www.iana.org/assignments/media-types/media-types.xhtml) and do validation, if you think this should be prioritized.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not necessary tbh. If backend is prepared to handle any wierd type ... then its totally fine!!

Copy link
Contributor

Choose a reason for hiding this comment

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

let's put a comment in here with the link to the accepted types

helloworld.md Outdated Show resolved Hide resolved
Copy link
Contributor

@vishalnarkhede vishalnarkhede left a comment

Choose a reason for hiding this comment

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

Lets wait for @nhannah 's review as well :)

Copy link
Contributor

@ferhatelmas ferhatelmas left a comment

Choose a reason for hiding this comment

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

LGTM (for tests)

@@ -1460,6 +1475,13 @@ export type Field = {
value?: string;
};

export type FileUploadConfig = {
Copy link
Contributor

Choose a reason for hiding this comment

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

why don't we use this type above ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

was following the way that it's done for other objects, which repeat fields rather than using the type.

Copy link
Contributor

Choose a reason for hiding this comment

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

any example for a reference ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, you're right. I thought firebase_config and apn_config did this, but I see now they have slightly different fields in AppSettings. I'll fix that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, they are different slightly but here is exactly same. Thanks for updating.

Copy link
Contributor

@ferhatelmas ferhatelmas left a comment

Choose a reason for hiding this comment

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

LGTM

@miagilepner miagilepner merged commit 00b7596 into master Jan 25, 2021
@delete-merged-branch delete-merged-branch bot deleted the feat/CHAT-1471-app-config-upload-types branch January 25, 2021 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants