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

Projects with an access policy won't display gsutil command #2202

Open
briangow opened this issue Mar 6, 2024 · 3 comments
Open

Projects with an access policy won't display gsutil command #2202

briangow opened this issue Mar 6, 2024 · 3 comments

Comments

@briangow
Copy link
Contributor

briangow commented Mar 6, 2024

Thanks to @elfeto for pointing out this issue. Projects that are attached to a GCP bucket and have an access policy won't display the gsutil command for downloading the files. Here is some relevant code:

       {% if is_authorized %}
        {% if project.allow_file_downloads %}
          {% if project.access_policy == AccessPolicy.CONTRIBUTOR_REVIEW %}
          {% endif %}
          {% if project.access_policy %}
            {% if project.compressed_storage_size %}
            {% endif %}
          {% else %}
            {% if project.gcp %}
              {% if project.gcp.sent_zip %}
              {% elif project.compressed_storage_size %}
              {% endif %}
              {% if project.gcp.sent_files %}
              {% endif %}
            {% elif project.compressed_storage_size %}
            {% endif %}
          {% endif %}

The

          {% else %}
            {% if project.gcp %}

won't get run since the project has an access_policy.

It will eventually go to: {% include "project/published_project_data_access.html" %} , which will always show:

         {% if project.gcp and project.gcp.sent_files %}
            <li><a href="{% url 'published_project_request_access' project.slug project.version 3 %}">Request access</a> to the files using the <a href="[https://console.cloud.google.com/storage/browser/{{](https://console.cloud.google.com/storage/browser/%7B%7B) project.gcp.bucket_name }}/">Google Cloud Storage Browser</a>. Login with a Google account is required.</li>
        {% endif %}
@bemoody
Copy link
Collaborator

bemoody commented Mar 7, 2024

As far as I know, we don't have a local database of who has permission to access restricted Google Cloud buckets. The only way to know who has access is to ask Google.

If you visit one of those restricted projects, you should see something that says "click here to request access to the Google Cloud bucket", and if you click that link, it should add you to the access list, and then send you instructions by email.

There are a lot of problems with this, but this is where we are currently.

@briangow
Copy link
Contributor Author

If you visit one of those restricted projects, you should see something that says "click here to request access to the Google Cloud bucket", and if you click that link, it should add you to the access list, and then send you instructions by email.

@bemoody , I believe the part you mention is working as expected. However, once the user is added to the access list and they return to the project page they will still see something like this "Request access to the files using the Google Cloud Storage Browser. Login with a Google account is required." as if they weren't added. However, if they click on the Google Cloud Storage Bucket link at this point they will be shown the files in the bucket.

Of course, we expect a different message with a gsutil command to be shown after the user is added to the access list.

@bemoody
Copy link
Collaborator

bemoody commented Mar 12, 2024

Sorry, I replied in a hurry and should have been more clear.

Of course, we expect a different message with a gsutil command to be shown after the user is added to the access list.

I agree that would be preferable. But since we don't keep a copy of the access list, we have no idea whether the current user is on the access list or not. So we have never supported what you're describing.

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

No branches or pull requests

2 participants