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

Zero width #4110

Merged
merged 10 commits into from
Jun 4, 2020
Merged

Zero width #4110

merged 10 commits into from
Jun 4, 2020

Conversation

SumithBaddam
Copy link
Contributor

Fixes #4061 Remove Zero-width characters from user input for collections, groups and users. Changes made to add a module names "remove_zero_width_chars" to String class. Striping the input by calling this function before performing operations.

@cjcolvar cjcolvar changed the base branch from master to develop May 4, 2020 17:53
Copy link
Member

@cjcolvar cjcolvar left a comment

Choose a reason for hiding this comment

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

This is Work In Progress. Tests need to be added to ensure #remove_zero_width_chars is performing as expected. We also want to move this into ApplicationController so it can be applied more generally. See this comment on the issue.

cjcolvar and others added 2 commits May 29, 2020 11:15
characters from all parameters including child arrays and hashes.

Co-authored-by: Sumith Baddam <sumith.reddy2@gmail.com>
Copy link
Member

@cjcolvar cjcolvar left a comment

Choose a reason for hiding this comment

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

This is looking good! I left a few comments of things to fix. I'll add tests for the application controller. Can you please remove commented out lines we added while working on this?

@cjcolvar cjcolvar dismissed their stale review June 4, 2020 18:02

I've done enough on this PR that we should have someone else review it besides me.

and testing simpler. Test ApplicationController and make methods
private.  Restore `.strip` in controllers for now but may want to add
this to a before_action in ApplicationController in a later commit.
Addressed rubocop style issues.
@cjcolvar cjcolvar merged commit 69ab031 into develop Jun 4, 2020
@cjcolvar cjcolvar deleted the zero_width branch June 4, 2020 21:30
@joncameron joncameron mentioned this pull request Jun 9, 2020
22 tasks
phuongdh pushed a commit that referenced this pull request Jun 9, 2020
Remove zero-width characters from the beginning and end of all parameters in all controller actions

* Add String#remove_zero_width_chars to remove all zero width unicode characters
* Add before action in ApplicationController to strip zero-width
characters from all parameters including child arrays and hashes.

Co-authored-by: Sumith Baddam <sumith.reddy2@gmail.com>
phuongdh pushed a commit that referenced this pull request Jun 9, 2020
Remove zero-width characters from the beginning and end of all parameters in all controller actions

* Add String#remove_zero_width_chars to remove all zero width unicode characters
* Add before action in ApplicationController to strip zero-width
characters from all parameters including child arrays and hashes.

Co-authored-by: Sumith Baddam <sumith.reddy2@gmail.com>
Dananji pushed a commit that referenced this pull request Sep 30, 2020
Remove zero-width characters from the beginning and end of all parameters in all controller actions

* Add String#remove_zero_width_chars to remove all zero width unicode characters
* Add before action in ApplicationController to strip zero-width
characters from all parameters including child arrays and hashes.

Co-authored-by: Sumith Baddam <sumith.reddy2@gmail.com>
Dananji pushed a commit that referenced this pull request Oct 26, 2020
Remove zero-width characters from the beginning and end of all parameters in all controller actions

* Add String#remove_zero_width_chars to remove all zero width unicode characters
* Add before action in ApplicationController to strip zero-width
characters from all parameters including child arrays and hashes.

Co-authored-by: Sumith Baddam <sumith.reddy2@gmail.com>
Dananji pushed a commit that referenced this pull request Oct 26, 2020
Remove zero-width characters from the beginning and end of all parameters in all controller actions

* Add String#remove_zero_width_chars to remove all zero width unicode characters
* Add before action in ApplicationController to strip zero-width
characters from all parameters including child arrays and hashes.

Co-authored-by: Sumith Baddam <sumith.reddy2@gmail.com>
bwatson78 pushed a commit to emory-libraries/avalon that referenced this pull request Nov 24, 2020
Remove zero-width characters from the beginning and end of all parameters in all controller actions

* Add String#remove_zero_width_chars to remove all zero width unicode characters
* Add before action in ApplicationController to strip zero-width
characters from all parameters including child arrays and hashes.

Co-authored-by: Sumith Baddam <sumith.reddy2@gmail.com>
bwatson78 pushed a commit to emory-libraries/avalon that referenced this pull request Nov 25, 2020
Remove zero-width characters from the beginning and end of all parameters in all controller actions

* Add String#remove_zero_width_chars to remove all zero width unicode characters
* Add before action in ApplicationController to strip zero-width
characters from all parameters including child arrays and hashes.

Co-authored-by: Sumith Baddam <sumith.reddy2@gmail.com>
bwatson78 pushed a commit to emory-libraries/avalon that referenced this pull request Nov 30, 2020
Remove zero-width characters from the beginning and end of all parameters in all controller actions

* Add String#remove_zero_width_chars to remove all zero width unicode characters
* Add before action in ApplicationController to strip zero-width
characters from all parameters including child arrays and hashes.

Co-authored-by: Sumith Baddam <sumith.reddy2@gmail.com>
devanshu-m pushed a commit to emory-libraries/avalon that referenced this pull request Dec 1, 2020
* Initial scafolding for adding transcripts

* Add file remove buttons

* Inline form for updating label

* Refine inline form edit for label

* Feedback fixes

* Simple model and controller for supplemental files
SupplementalFile ids should always be strings
New Avalon error classes

* Use activestorage for storing supplemental files.

* Configure development to use minio

* Display supplemental files in item view page

* Avoid reifying from fedora by copying method to speedy_af proxy

* Only display files tab if there are files present; Use display_title instead of title

* Add tests for SpeedyAF MasterFile Proxy; fix #encoder_class

* Place view raw link at the bottom of details tab

* Remove commented out line

* Remove section title in files tab when there are no files

* Fix spacing

* Handle errors when attaching files

* Add default to SpeedyAF call to avoid reifying

* Skip waveform generation if no audio track

* Add support for jump forward and backwards in ME.js player, support keyboard actions when player is on page

* Make active-storage configurable

* Carry forward selected quality from a section to the next

* Zero width (avalonmediasystem#4110)

Remove zero-width characters from the beginning and end of all parameters in all controller actions

* Add String#remove_zero_width_chars to remove all zero width unicode characters
* Add before action in ApplicationController to strip zero-width
characters from all parameters including child arrays and hashes.

* Also catch LoadError (avalonmediasystem#4136)

LoadError is thrown by the AWS SDK when the activestorage adapter is set to s3 but is not configured properly.

* Show error messages when creating/updating collections

* Use activestorage for storing supplemental files.

* Add tests for SpeedyAF MasterFile Proxy; fix #encoder_class

* Use Object#const_get instead of ActiveEncode::Base.descendants to get
encoder class to avoid issue of #descendants iterating over all
instatiated objects and possibly returning classes that are not longer
declared as constants.  This is probably an edge-case which only affects
tests but this new approach may also be faster.

Also declare classes as anonymous classes and stub constants within
test.

* Simply and avoid error handling by using safe_constantize

* Catch top-most Exception since LoadError can be thrown

* Make active-storage configurable

* Cache s3 object locally for faster waveform job (avalonmediasystem#4154)

* Refactor s3 localize code to FileLocator

* Cache s3 object locally for faster waveform job

* Fix passthrough test

* Use Tempfile for easy clean up

* Update spec/jobs/waveform_job_spec.rb

Co-authored-by: Chris Colvard <cjcolvar@indiana.edu>

* Fix route reference

Without this change, an error is thrown when attempting to switch impersonation sessions (become a user while already impersonating another user).  We might want to consider if we should even allow this but it is possible right now.

* Use << instead of += since = isn't defined for ActiveModel::Errors

NoMethodError (undefined method `[]=' for #<ActiveModel::Errors:0x000055b310fcd780>)

* Add tests for IntercomPush job

* Fix on feedback and replace alert when there is an alert present

* Only install individual aws-sdk gems we need

* Add Manage Jobs to Manage menu

* Fix for filtering items in a collection when collection name contains special characters

* Check for player existence before getting duration

* Fix skip transcoding on AWS

* Pin Bixby to 2.0.0 to fix CodeClimate

* Fix playback in Android devices using native HLS

* Fix rake:aws:create_presets not working (avalonmediasystem#4187)

* Fixes :4178 Removed nil values from templates and added test scripts

* Fixes :4178 Removed nil values from templates and added test scripts

* Made changes to syntax based on review

* Removed duplicate package import

Co-authored-by: Baddam <srbaddam@iu.edu>

* Enable/disable keyboard shortcuts for ME.js when forms and modals are on page

* Fix S3 localizer

* Fix skip transcoding with real S3

* Update rack to 2.2.3

* Update jquery-rails to 4.4.0

* Fix mediainfo v20.03 problem with S3 presigned URL

* Add avalon:user:admin rake task

When using an omniauth provider such as google, it is helpful to be able
to assign initial administrators to an Avalon application. This commit
adds a rake task to prompt the user for an email address of a user to
assign the administrator role.

Usage:
```
[avalon@lib-avalon-dev current]$ bundle exec rake avalon:user:admin
Assign user as an administrator
Email address for user: mcritchlow@ucsd.edu
Successfully assigned mcritchlow as an administrator
```

If a user does not exist in the system:
```
[avalon@lib-avalon-dev current]$ bundle exec rake avalon:user:admin
Assign user as an administrator
Email address for user: notauser@example.com
User with email address notauser@example.com not found
```

* Fix mediainfo path for active_encode so it works with v20.03

* Delete dropbox directory when deleting a collection (avalonmediasystem#4223)

* [WIP] Delete dropbox directory when deleting a collection

* Delete dropbox folder either in file system/s3 bucket based on settings

* Fix dropbox path name

* Fixed from feedback

* Delete collection s3 dropbox when empty

* Fixes from feedback

* Fix failing tests

* Handling collection names with s3 special characters. Added test case for the same. (avalonmediasystem#4230)

* Handling collection names with s3 special characters. Added test case for the same

* Handling collection names with s3 special characters. Added test case for the same

Co-authored-by: Sumith Baddam <srbaddam@iu.edu>

* Remove RTMP references. Fix streaming auth for MDPI

* Remove RTMP tests

* Fix failing tests

* Require Git SCM plugin for Capistrano

To prevent deprecation warnings such as:

```
[Deprecation Notice] Future versions of Capistrano will not load the Git SCM
plugin by default. To silence this deprecation warning, add the following to
your Capfile after `require "capistrano/deploy"`:
    require "capistrano/scm/git"
    install_plugin Capistrano::SCM::Git
```

* Add an intermediate page when accessing restricted content

Co-authored-by: Sumith Reddi Baddam <sumith.reddy2@gmail.com>

* Fix failing tests

* Manager should not see unpublished items from others' collections in the search

Co-authored-by: Chris Colvard <cjcolvar@indiana.edu>

* Fixes avalonmediasystem#4224 Creates Dropbox directory when collection is created. (avalonmediasystem#4241)

* Fixes avalonmediasystem#4224 Creates Dropbox directory when collection is created.

* Fixing failing test cases

Co-authored-by: Baddam <srbaddam@iu.edu>

* Bug fix for adding new timespans at root level of structure

* Bump lodash from 4.17.15 to 4.17.19

* Support for adding supplemental files at the media object level

Co-authored-by: Phil Dinh <phuongdh@gmail.com>

[WIP] Adding tests for the supplemental files controller

Co-authored-by: Phil Dinh <phuongdh@gmail.com>

Complete tests for supplemental files controller

Co-authored-by: Phil Dinh <phuongdh@gmail.com>

Move captions and supplemental to Manage Files tab

Co-authored-by: Dananji Withana <dwithana@iu.edu>

Fix CSS issues and rework views

Co-authored-by: Dananji Withana <dwithana@iu.edu>

Change forms in file upload step to update each master file in masterfiles controller

Co-authored-by: Phil Dinh <phuongdh@gmail.com>

Add more UI fixes for Manage files step

Co-authored-by: Dananji Withana <dwithana@iu.edu>

Fix CodeClimate issues

Add end user UI, fix test

Fix failing tests

Fix indentation

* Add tests and fix poster update

* Add support for merging multiple items (avalonmediasystem#4248)

* Add initial support for merging multiple items

* Add UI to bulk merge feature

* Add and fix tests for merge feature

* Use blacklight locale, check items count in merge

* Use okcomputer gem for health check

Co-authored-by: Phil Dinh <phuongdh@gmail.com>

* Rework okcomputer checks

* Fix overwhelming Blacklight deprecation warnings

* Bump elliptic from 6.5.2 to 6.5.3

Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](indutny/elliptic@v6.5.2...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

* Add deployment tips to README

* Add feature to apply Collection access to items

Co-authored-by: Dananji Withana <dwithana@iu.edu>

* Fix CodeClimate issues

* Add tests improve code coverage

* Generate and use an empty waveform file in SME when masterfile is missing the waveform.json

* Fixes from feedback

* Increase default Fedora timeout for production

* Display access restrictions on item view page

* Display access for leases and add tests

* Bump http-proxy from 1.17.0 to 1.18.1

Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.17.0 to 1.18.1.
- [Release notes](https://github.com/http-party/node-http-proxy/releases)
- [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md)
- [Commits](http-party/node-http-proxy@1.17.0...1.18.1)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump node-sass from 4.11.0 to 4.14.1

Bumps [node-sass](https://github.com/sass/node-sass) from 4.11.0 to 4.14.1.
- [Release notes](https://github.com/sass/node-sass/releases)
- [Changelog](https://github.com/sass/node-sass/blob/master/CHANGELOG.md)
- [Commits](sass/node-sass@v4.11.0...v4.14.1)

Signed-off-by: dependabot[bot] <support@github.com>

* Fix waveform overflow in SME

* Fix rake create_presets for AWS

* Update ffmpeg_presets.yml

Add '-ac 2' option to video encodes to force stereo mixdown

* Run cron jobs on Sidekiq

* Add and fix tests, remove whenever

* Add libyaz for building and using zoom gem

* Fix timeliner create bug when using custom scope

* Avoid duplicated LTI providers

Already handled in the initializer

* Align player elements in embedded player

* fix: package.json to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-UAPARSERJS-610226

* Clean up whenever leftovers

* Check for Redis before creating cron jobs

* Bug fixes

* Remove skip forwards/backward icons in the player toolbar preserving keyboard shortcuts

* Fix MasterFile supplemental file path

* Bump version to 7.2

* Fix MasterFile supplemental file path

* Add object_supplemental_file_path tests

* Fix waveform failing

* Upgrade Rails to 5.2.4.4 for XSS fix

* Fix merge conflict leftover

* Change colors to use Emory branding

* Adds initial shib config

* Adds saml config to authentication file so that view helpers can link saml integration

* Adds saml config params to auth and to settings yml (#111)

* This commit also changes the uid to point to the urn for PPID
and adds additional attrs to statements.

* Updates schema.

* Add file remove buttons

* Inline form for updating label

* Feedback fixes

* Simple model and controller for supplemental files
SupplementalFile ids should always be strings
New Avalon error classes

* Use activestorage for storing supplemental files.

* Configure development to use minio

* Display supplemental files in item view page

* Only display files tab if there are files present; Use display_title instead of title

* Skip waveform generation if no audio track

* Add support for jump forward and backwards in ME.js player, support keyboard actions when player is on page

* Make active-storage configurable

* Use activestorage for storing supplemental files.

* Add tests for SpeedyAF MasterFile Proxy; fix #encoder_class

* Use Object#const_get instead of ActiveEncode::Base.descendants to get
encoder class to avoid issue of #descendants iterating over all
instatiated objects and possibly returning classes that are not longer
declared as constants.  This is probably an edge-case which only affects
tests but this new approach may also be faster.

Also declare classes as anonymous classes and stub constants within
test.

* Simply and avoid error handling by using safe_constantize

* Make active-storage configurable

* Cache s3 object locally for faster waveform job (avalonmediasystem#4154)

* Refactor s3 localize code to FileLocator

* Cache s3 object locally for faster waveform job

* Fix passthrough test

* Use Tempfile for easy clean up

* Update spec/jobs/waveform_job_spec.rb

Co-authored-by: Chris Colvard <cjcolvar@indiana.edu>

* Fix mediainfo v20.03 problem with S3 presigned URL

* Fix mediainfo path for active_encode so it works with v20.03

* Handling collection names with s3 special characters. Added test case for the same. (avalonmediasystem#4230)

* Handling collection names with s3 special characters. Added test case for the same

* Handling collection names with s3 special characters. Added test case for the same

* Support for adding supplemental files at the media object level

[WIP] Adding tests for the supplemental files controller

Complete tests for supplemental files controller

Move captions and supplemental to Manage Files tab

Fix CSS issues and rework views

Change forms in file upload step to update each master file in masterfiles controller

Add more UI fixes for Manage files step

Fix CodeClimate issues

Add end user UI, fix test

Fix failing tests

Fix indentation

* Use okcomputer gem for health check


* Add feature to apply Collection access to items


* Add tests improve code coverage

* Run cron jobs on Sidekiq

* Add and fix tests, remove whenever

* Remove skip forwards/backward icons in the player toolbar preserving keyboard shortcuts

* Fix merge conflict leftover

* Adds initial shib config

* Adds saml config params to auth and to settings yml (#111)

* This commit also changes the uid to point to the urn for PPID
and adds additional attrs to statements.

* Removes doubled saml config entry.

* Reinserts missing configuration key.

* Removes double configuration after rebase to main.

* Removes extra end left in after rebase.
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.

Avalon Doesn't Remove Zero Width Space Character
4 participants