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

WIP: GraphQL API (public parts) #888

Open
wants to merge 50 commits into
base: main
Choose a base branch
from
Open

WIP: GraphQL API (public parts) #888

wants to merge 50 commits into from

Conversation

Kurocon
Copy link
Member

@Kurocon Kurocon commented Sep 2, 2024

Please add the following information to your pull request:

Please describe what your PR is fixing
Adds a GraphQL API for public resources.

Concretely, which issues does your PR solve? (Please reference them by typing Fixes/References Inter-Actief/amelie#<issue_id>)
Fixes #741

Does your PR change how we process personal data, impact our privacy document, or modify (one of) our data export(s)?
no

Does your PR include any django migrations?
no

Does your PR include the proper translations (did you add translations for new/modified strings)?
yes, I have included the translations

Does your PR include CSS changes (and did you run the compile_css.sh script in the scripts directory to regenerate the compiled.css file)?
no, my PR does not include CSS changes

Does your PR need external actions by for example the System Administrators? (Think about new pip packages, new (local) settings, a new regular task or cronjob, new management commands, etc.)?
no

Did you properly test your PR before submitting it?
yes

Kurocon and others added 30 commits April 17, 2023 20:54
…le-to-graphql

Add the activities module to graphql
…le-to-graphql

Add descriptions to attributes and their translations
Add the companies module to the graphql api
…-the-graphql-api

Add about pages to the GraphQL API
supertom01 and others added 6 commits June 10, 2024 22:43
…-to-the-graphql-api

825 add the calendar module to the graphql api
…ional-bouquet

Add mutation for the educational bouquet
# Conflicts:
#	locale/nl/LC_MESSAGES/django.mo
#	locale/nl/LC_MESSAGES/django.po
@Kurocon
Copy link
Member Author

Kurocon commented Sep 2, 2024

Some (previously) private information is currently made public that we (probably) don't want:

ActivityType: (something seems to go wrong with the fields specification here as well)

  • callbackUrl (possibly internal URL of external party)
  • callbackSecretKey (secret passed to callback to verify its us)
  • facebookEventId (probably irrelevant)
  • updateCount (internal attribute for icals)
  • placesAvailable (only show when logged in)
  • hasWaitingParticipants (internal attribute)

CommitteeType:

  • abbreviation (internal attribute for LDAP groups in Claudia)

AttachmentType:

  • non-public attachments are visible

WebsiteBannerType / TelevisionBannerType / VivatBannerType:

  • startDate (exposes contract information)
  • endDate (exposes contract information)
  • Only active banners should be visible

Rest looks good as far as I can tell!

@Kurocon
Copy link
Member Author

Kurocon commented Sep 2, 2024

We probably should also add unit tests for each attribute that is only shown when authenticated, to make sure it doesn't end up being publicly available at a later point. Graphene has some facilities for this: https://docs.graphene-python.org/projects/django/en/latest/testing/

@Kurocon Kurocon changed the title GraphQL API (public parts) WIP: GraphQL API (public parts) Oct 14, 2024
@Kurocon Kurocon changed the title WIP: GraphQL API (public parts) GraphQL API (public parts) Dec 9, 2024
@Kurocon
Copy link
Member Author

Kurocon commented Dec 9, 2024

As far as I can tell, the tests are as done as they could be for now.
So, this is ready for merging!

Copy link
Member

@supertom01 supertom01 left a comment

Choose a reason for hiding this comment

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

Some very minor comments, but other than that good

amelie/settings/local.py.default Outdated Show resolved Hide resolved
amelie/settings/local.py.localdev Outdated Show resolved Hide resolved
amelie/graphql/tests/__init__.py Outdated Show resolved Hide resolved
amelie/graphql/tests/__init__.py Outdated Show resolved Hide resolved
amelie/graphql/tests/__init__.py Outdated Show resolved Hide resolved
amelie/graphql/tests/__init__.py Outdated Show resolved Hide resolved
amelie/graphql/tests/__init__.py Show resolved Hide resolved
amelie/graphql/tests/test_activities.py Outdated Show resolved Hide resolved
amelie/graphql/tests/test_education.py Show resolved Hide resolved
amelie/graphql/tests/test_news.py Outdated Show resolved Hide resolved
@Kurocon Kurocon requested a review from supertom01 December 23, 2024 12:12
@Kurocon Kurocon changed the title GraphQL API (public parts) WIP: GraphQL API (public parts) Dec 24, 2024
@Kurocon
Copy link
Member Author

Kurocon commented Dec 24, 2024

New todo: Convert existing GraphQL moduels to the new authorization format.

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.

GraphQL API
3 participants