Skip to content
This repository has been archived by the owner on Mar 24, 2020. It is now read-only.

Add secureToken function #457

Merged
merged 2 commits into from
Jun 1, 2018
Merged

Add secureToken function #457

merged 2 commits into from
Jun 1, 2018

Conversation

VivianChu
Copy link
Member

Fixes #448 ; refs #448

@ucsdlib/developers - please review

Add securetoken test

Update tests

Fix failed test

Change the end time
Copy link
Member

@mcritchlow mcritchlow left a comment

Choose a reason for hiding this comment

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

Looks good to me! Couple questions, but I'd also 👍 as-is

file_name = grab_file_name(field_data, cmp_id)
return nil unless file_name
obj_path = obj_id.scan(/.{1,2}/).join('/')
"#{base_url}#{obj_path}/20775-#{obj_id}-#{file_name}".html_safe
Copy link
Member

Choose a reason for hiding this comment

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

This is a little nitpicky, but I'm wondering about having 20775 hardcoded here (and I think I saw it in one or two other places too. Should we put this in a config file or a one line method? I think the title for this would be something like ark_naan making an acronym out of Name Assigning Authority Number

# @return string or nil
#---

def grab_file_name(field_data, cmp_id)
Copy link
Member

Choose a reason for hiding this comment

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

is this used for non audio-video files? It seems specifically a look up for them. If so, maybe the name of the method should indicate that?

@VivianChu
Copy link
Member Author

@mcritchlow - The code has been updated. Could you review them again? Thanks

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 66.114% when pulling 1586e8b on feature/secureToken into 683aea5 on develop.

@mcritchlow
Copy link
Member

LGTM 👍

@lsitu
Copy link
Member

lsitu commented May 31, 2018

👍

@lsitu lsitu merged commit ca4f3e5 into develop Jun 1, 2018
@lsitu lsitu deleted the feature/secureToken branch June 1, 2018 17:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants