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

add federation #972

Merged
merged 44 commits into from
Oct 7, 2023
Merged

add federation #972

merged 44 commits into from
Oct 7, 2023

Conversation

jeriox
Copy link
Contributor

@jeriox jeriox commented Jun 7, 2023

first draft with on-demand events fetching according to design blog.

  • frontend view that collects shared events from hosts
    • make it look like the regular event view
    • display correct signup url
  • views for OAuth flow
    • transmit qualifications
    • note that other inclusions may lead to weird stuff
  • event detail view for federated users
    • decide how to authorize against host
    • permission checking (is the event shared for the guest?)
  • shift signup for federated users
  • view to manage share for an event
    • use checkboxmultiselect
  • invite-flow
    • add explanations
    • add delete views
    • prevent OAuth app from being deleted
    • handle invite code expiration
    • confirmation view when redeeming code
    • show invite code in reveal view
    • invite code with URL as complete link
  • fix naming
    • Menüpunkt: Externe Veranstaltungen
    • Plugin: Federation
    • Eventform: Share event with other ephios instances
    • Settings: Ephios instances that you share events with; Ephios instances that share events with you: Share events with someone else; Enter invite key
  • check if own permission class for sharedeventlistview is a good idea (maybe set guest there?) -> doesn't make sense as the signature only allows to return a user and one cannot set stuff in the request
  • tests

@coveralls
Copy link

coveralls commented Jun 7, 2023

Coverage Status

coverage: 87.802% (-0.8%) from 88.644% when pulling d6705e7 on federation into 34fee3e on main.

@felixrindt felixrindt self-requested a review June 12, 2023 19:25
Comment on lines 77 to 98
response = requests.post(
urljoin(data["host_url"], reverse("federation:redeem_invite_code")),
data={
"name": global_preferences_registry.manager()["general__organization_name"],
"url": data["guest_url"],
"client_id": oauth_application.client_id,
"client_secret": oauth_application.client_secret,
"code": data["code"],
},
)

Check failure

Code scanning / CodeQL

Full server-side request forgery

The full URL of this request depends on a [user-provided value](1).
ephios/plugins/federation/views/frontend.py Fixed Show fixed Hide fixed
@jeriox jeriox marked this pull request as ready for review June 14, 2023 21:42
Comment on lines +35 to +45
r = requests.get(
urljoin(host.url, reverse("federation:shared_event_list_view")),
headers={"Authorization": f"Bearer {host.access_token}"},
timeout=5,
)

Check failure

Code scanning / CodeQL

Full server-side request forgery

The full URL of this request depends on a [user-provided value](1).
@jeriox jeriox requested a review from felixrindt July 20, 2023 21:43
ephios/api/views/users.py Show resolved Hide resolved
ephios/plugins/federation/views/frontend.py Outdated Show resolved Hide resolved
ephios/plugins/federation/views/api.py Outdated Show resolved Hide resolved
ephios/plugins/federation/views/api.py Outdated Show resolved Hide resolved
ephios/plugins/federation/views/api.py Outdated Show resolved Hide resolved
ephios/plugins/federation/forms.py Show resolved Hide resolved
ephios/plugins/federation/views/api.py Outdated Show resolved Hide resolved
@felixrindt felixrindt added this to the Dennis milestone Aug 6, 2023
@felixrindt felixrindt added the [C] feature New feature or request label Aug 6, 2023
@jeriox jeriox requested a review from felixrindt August 7, 2023 17:39
ephios/plugins/federation/views/frontend.py Outdated Show resolved Hide resolved
ephios/plugins/federation/signals.py Outdated Show resolved Hide resolved
ephios/plugins/federation/models.py Outdated Show resolved Hide resolved
ephios/plugins/federation/models.py Outdated Show resolved Hide resolved
ephios/plugins/federation/signals.py Outdated Show resolved Hide resolved
ephios/plugins/federation/signals.py Outdated Show resolved Hide resolved
@felixrindt felixrindt mentioned this pull request Aug 10, 2023
1 task
tests/settings.py Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@jeriox jeriox enabled auto-merge (squash) October 7, 2023 22:39
@jeriox jeriox merged commit 078333b into main Oct 7, 2023
@jeriox jeriox deleted the federation branch October 7, 2023 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants