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

Return no_user_key when there is no user for a request. #135

Closed
wants to merge 1 commit into from

Conversation

cmeiklejohn
Copy link
Contributor

Ensure that we return no_user_key when the user making the request is unauthenticated.

Fixes the following server error, when accessing a public asset without authentication.

{error,badarg,
       [{erlang,list_to_binary,[undefined]},
        {riak_moss_utils,get_user,2},
        {riak_moss_wm_service,forbidden,2},
        {webmachine_resource,resource_call,3},
        {webmachine_resource,do,3},
        {webmachine_decision_core,resource_call,1},
        {webmachine_decision_core,decision,1},
        {webmachine_decision_core,handle_request,2}]}

I wasn't sure the correct way to approach the eunit test for this functionality. Should I just unit test the get_user method, or do we prefer to test this a different way?

@cmeiklejohn
Copy link
Contributor Author

Oops.

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.

1 participant