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

Introduce per-user path restrictions [RHELDST-23442] #691

Conversation

crungehottman
Copy link
Member

Previously, exodus-gw's publish APIs allowed any authorized user to publish to any paths within a given CDN environment.

Now, it is possible to restrict individual users to publishing to certain paths in a given CDN environment using the publish_paths setting, or the EXODUS_GW_PUBLISH_PATHS environment variable.

An example of the publish paths config:

{
"pre": {
"fake-user": [
"^(/content)?/origin/files/sha256/[0-f]{2}/[0-f]{64}/[^/]{1,300}$"
],
},
"live": {
"fake-user": [
"^(/content)?/origin/files/sha256/[0-f]{2}/[0-f]{64}/[^/]{1,300}$"
],
}
}

Any clients identified in the config are authorized to publish to any path which matches the defined regex. When a client attempts to publish to a path to which does not match the defined regex, they will get a 403 response. Any client which is not included in the publish_paths config will be authorized to publish to any path (assuming they have the necessary publish roles).

This should reduce the risk of conflicts and other issues between exodus-gw users.

exodus_gw/routers/publish.py Outdated Show resolved Hide resolved
exodus_gw/settings.py Outdated Show resolved Hide resolved
exodus_gw/routers/publish.py Outdated Show resolved Hide resolved
exodus_gw/routers/publish.py Outdated Show resolved Hide resolved
Previously, exodus-gw's publish APIs allowed any authorized user
to publish to any paths within a given CDN environment.

Now, it is possible to restrict individual users to publishing to
certain paths in a given CDN environment using the publish_paths
setting, or the EXODUS_GW_PUBLISH_PATHS environment variable.

An example of the publish paths config:

{
  "pre": {
    "fake-user": [
      "^(/content)?/origin/files/sha256/[0-f]{2}/[0-f]{64}/[^/]{1,300}$"
    ],
  },
  "live": {
    "fake-user": [
      "^(/content)?/origin/files/sha256/[0-f]{2}/[0-f]{64}/[^/]{1,300}$"
    ],
  }
}

Any clients identified in the config are authorized to publish to
any path which matches the defined regex. When a client attempts
to publish to a path to which does not match the defined regex,
they will get a 403 response. Any client which is not included in
the publish_paths config will be authorized to publish to any path
(assuming they have the necessary publish roles).

This should reduce the risk of conflicts and other issues between
exodus-gw users.
@crungehottman crungehottman merged commit 0cfb0fc into release-engineering:master Apr 16, 2024
3 checks passed
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.

None yet

2 participants