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

feat: add studio write access validation #55

Merged
merged 3 commits into from
Sep 6, 2023

Conversation

germanolleunlp
Copy link
Member

Add studio write access validation

Ticket: https://jira.2u.com/browse/ACADEMIC-16359

Merge checklist:
Check off if complete or not applicable:

  • Version bumped
  • Changelog record added
  • Documentation updated (not only docstrings)
  • Fixup commits are squashed away
  • Unit tests added/updated
  • Manual testing instructions provided
  • Noted any: Concerns, dependencies, migration issues, deadlines, tickets

@germanolleunlp germanolleunlp force-pushed the go/has-studio-write-access branch from 9835cff to 5f2911e Compare August 29, 2023 20:14
Copy link
Contributor

@ashultz0 ashultz0 left a comment

Choose a reason for hiding this comment

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

needs a changelog entry and update of version number, probably to 3.5.0

thoughts about organization you can take or leave

also it might need the decorator that actually requires and decodes a user on the view calls

ai_aside/platform_imports.py Outdated Show resolved Hide resolved
ai_aside/api/__init__.py Outdated Show resolved Hide resolved
tests/api/test_views.py Outdated Show resolved Hide resolved
tests/api/test_views.py Outdated Show resolved Hide resolved
ai_aside/config_api/views.py Outdated Show resolved Hide resolved
ai_aside/api/view_utils.py Outdated Show resolved Hide resolved
ai_aside/api/view_utils.py Outdated Show resolved Hide resolved
ai_aside/api/__init__.py Outdated Show resolved Hide resolved
ai_aside/api/permissions.py Outdated Show resolved Hide resolved
@germanolleunlp germanolleunlp force-pushed the go/has-studio-write-access branch 6 times, most recently from 582c157 to 3bb68e0 Compare September 4, 2023 14:30
@germanolleunlp
Copy link
Member Author

needs a changelog entry and update of version number, probably to 3.5.0

thoughts about organization you can take or leave

also it might need the decorator that actually requires and decodes a user on the view calls

💹 done

@germanolleunlp germanolleunlp force-pushed the go/has-studio-write-access branch from 3bb68e0 to d797c7a Compare September 4, 2023 14:44
@germanolleunlp germanolleunlp force-pushed the go/has-studio-write-access branch 2 times, most recently from 28fd65e to 89798e4 Compare September 5, 2023 13:26
* Add SessionAuthentication
* Add JwtAuthentication
@germanolleunlp germanolleunlp force-pushed the go/has-studio-write-access branch from 89798e4 to 9cfec12 Compare September 5, 2023 13:27
can_change_summaries_settings.return_value = False
self.access_mock = patch('ai_aside.platform_imports.can_change_summaries_settings',
can_change_summaries_settings)
self.access_mock.start()
Copy link
Contributor

Choose a reason for hiding this comment

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

this is a weird python resource leak technicality

in super.setup it makes self.accessmock and starts it, let's call that mock1
then here you reassign self.accessmock to a new mock and start it, that's mock2
there is no longer any reference available to mock1, self.accessmock is now mock2

in teardown we tear down mock2. mock1 is never torn down.

I don't think that mocks really leak anything significant especially if you never start them so this is just something to notice. Fixing it would just be not calling super setup or delegating mock creation into a function which reads self.can_change_summaries or a million other methods.

Copy link
Contributor

Choose a reason for hiding this comment

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

this is worth knowing about but not a blocker to merge I think

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks!

@germanolleunlp germanolleunlp merged commit ccfacd8 into main Sep 6, 2023
@germanolleunlp germanolleunlp deleted the go/has-studio-write-access branch September 6, 2023 13:01
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.

2 participants