forked from berkeley-cdss/flextensions
-
Notifications
You must be signed in to change notification settings - Fork 4
Add API token management system #344
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
Open
ba88im
wants to merge
117
commits into
main
Choose a base branch
from
ba88im-superset/ba88im/api-tokens
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
117 commits
Select commit
Hold shift + click to select a range
9d54d77
Bump puma from 7.1.0 to 7.2.0
dependabot[bot] 25440d9
Bump bootsnap from 1.20.1 to 1.21.1
dependabot[bot] 130dcf0
Bump pg from 1.6.2 to 1.6.3
dependabot[bot] 2d2df34
Add a /help redirect, move some routes around
cycomachead d7d3f5a
Allow overriding PORT
cycomachead 6fa8036
Gradescope note
cycomachead 21ab42f
improved GS user copy
cycomachead 2bfee06
gitignore
cycomachead 46e180c
Bump sentry-rails from 6.2.0 to 6.3.0
dependabot[bot] 7901b6d
Bump axe-core-cucumber from 4.11.0 to 4.11.1
dependabot[bot] c0b1dd2
Bump bootstrap from 5.3.5 to 5.3.8
dependabot[bot] 85b270e
Bump turbo-rails from 2.0.21 to 2.0.23
dependabot[bot] 2c3b5a5
Bump rubocop from 1.82.1 to 1.84.2
dependabot[bot] fc075bb
Bump bootsnap from 1.21.1 to 1.23.0
dependabot[bot] f9b895f
Bump sentry-ruby from 6.3.0 to 6.3.1
dependabot[bot] 9208b4e
Bump annotaterb from 4.20.0 to 4.22.0
dependabot[bot] a435169
Bump faraday in the bundler group across 1 directory
dependabot[bot] 5181fd6
Bump brakeman from 7.1.2 to 8.0.2
dependabot[bot] 1606bcc
Bump selenium-webdriver from 4.40.0 to 4.41.0
dependabot[bot] b148ff8
Bump rspec-rails from 8.0.2 to 8.0.3
dependabot[bot] 3f2fe32
Bump json from 2.18.0 to 2.18.1
dependabot[bot] bfc40b8
Bump sentry-rails from 6.3.0 to 6.3.1
dependabot[bot] baf9e83
Bump fast-xml-parser in the npm_and_yarn group across 1 directory
dependabot[bot] 90fa511
update psql version and enable enhanced cloudwatch metrics
dg-ucb 9a7785a
Fix cloudwatch agent config race condition
dg-ucb 4f86893
Fix undefined method `map` for nil when approving extension requests
cycomachead 596b038
Publish developers doc
brandosu 9308345
Bump sentry-ruby from 6.3.1 to 6.4.0
dependabot[bot] d9abf76
Bump sentry-rails from 6.3.1 to 6.4.0
dependabot[bot] cbf7785
Initial plan
Copilot 3b62f62
Add updates page to docs with initial release entry and GitHub releas…
Copilot 76fa6be
feat: handle late due dates for Canvas and Gradescope extensions
cycomachead 891ebb4
delint part 1
cycomachead 8735285
cleanup lints
cycomachead 611a693
run migrations
cycomachead c4ba73a
fixup spec
cycomachead c9068e3
delete test case which seems impossible
cycomachead a8de5bf
cleanup the Canvas facade to not always send a late due date
cycomachead 934d122
ignore claude
cycomachead 9ce6820
Reorder settings
cycomachead 59d2254
Rebased branch
gobears01 d79067b
delint part 1
cycomachead e0bba4d
cleanup lints
cycomachead f6ef322
fixup spec
cycomachead 226f7e1
delete test case which seems impossible
cycomachead b1f89d6
cleanup the Canvas facade to not always send a late due date
cycomachead b9353e0
Reorder settings
cycomachead fefa05f
refactor: extract extension date logic to AssignmentDateCalculator
cycomachead bb88f17
minor delint
cycomachead 9896773
tidy specs
cycomachead 0b1f252
Tidy rubocop
cycomachead c24badc
Add a few notes
cycomachead 08c4bc5
tidy docs, add DOI info
cycomachead 11034a9
more updates
cycomachead d11d44e
Add project info.yml metadata
ba88im 8b05efa
Add tests for enrollments-to-requests search filter
alxstx 3b9382e
Add step definitions and test data for enrollments-to-requests
alxstx 01dc86f
Bump brakeman from 8.0.2 to 8.0.4
dependabot[bot] 22ef95f
Update a bunch of smaller dependencies for testing, etc
cycomachead f7c7b07
update sentry
cycomachead 4adc27b
bump rubocop-rails and delint
cycomachead 0f4e560
bump rubocop-rspec and delint
cycomachead 31fa074
bump mail gem
cycomachead 333419b
bundle update guard / deps
cycomachead 114efed
bump globalid
cycomachead 036cd72
Minor transitive deps updates
cycomachead 5606c16
More transitive deps updates
cycomachead 73a1b96
Bump the npm_and_yarn group across 1 directory with 2 updates
dependabot[bot] 2b68ba7
Bump dompurify in the npm_and_yarn group across 1 directory
dependabot[bot] 38841d1
Added the changes per prof Ball requests
gobears01 5acc7b2
delint
cycomachead 9cfbbb3
Rename README to make docs more clear
cycomachead d2ae5c3
Setup local github pages in docs directory
cycomachead 099d3ea
WIP tidy docs
cycomachead 9cd9d31
minor README tweaks
cycomachead 63a1380
Fix some small issues
cycomachead 7e0e8d1
Add environment variable to docs build
cycomachead 4f9ef23
More docs updates
cycomachead 3ff2c32
Bump undici in the npm_and_yarn group across 1 directory
dependabot[bot] 15e185c
Run bundle update --minor
cycomachead 6f55b2d
Moved approve/ reject selected buttons to the bottom of the requests …
gobears01 fb80739
Moved Approve/ Reject Selected buttons to the left, changed checkboxe…
gobears01 a409b92
added student notes + tests
noahnizamian fa3a1d6
Add updated schema.rb for student notes migration
noahnizamian 1e4fce3
fixed tests
noahnizamian ab480a1
Add API token model, management UI, and migration tooling
ba88im 9a72c8c
Fix rubocop offenses and update schema.rb for CI
ba88im a6b5d4b
Fix Zeitwerk naming and Rubocop DynamicFindBy
ba88im 404be48
Fix token generation: use before_validation instead of before_create
ba88im 95096f7
Fix association tests: replace shoulda-matchers with plain RSpec
ba88im 17f206f
Address PR review feedback for API tokens
ba88im af2a3d3
Async sync enrollments and sync assignments, added UI to indicate pen…
gobears01 556182c
Added dotenv gem to run app locally
gobears01 f6a4434
Add Procfile for Heroku web and worker dynos
gobears01 4a5bf8c
Added more RSpec and cucumber tests
gobears01 e807177
Add RSpec and Cucumber tests for async syncs
gobears01 7701fab
Fixed Ruby lint
gobears01 17a375f
Changed polling time to 1s
gobears01 25d7799
Added initializer for good_job
gobears01 5396841
scoping lograge current_user to app controllers
gobears01 f416d98
Retrigger CI
gobears01 071c68b
Fix undefined _fetchJson call in assignment_controller sync
gobears01 805d9c8
Resolved merge conflict sync_assignment method
gobears01 258aeea
Merge branch 'main' into gem-dashboards
gobears01 3a1010e
Fix rubocop: remove extra empty line at block body end
gobears01 15d7042
Added UI dashboards
gobears01 2c024bb
Fixed headers and added admin tools heading
gobears01 6a98d64
Added cucumber scenariosfor admin tools
gobears01 322f42b
Added ID for navbar and tests
gobears01 6f2cdb0
Merge remote-tracking branch 'origin/main' into ba88im-superset/ba88i…
ba88im 23f0263
Add Enable All / Disable All assignments bulk action (#273)
ba88im 37c1893
Merge PR #354: Add Enable All / Disable All assignments bulk action
ba88im a5abb9a
Merge origin/admin-UI: async sync UI, dashboards, admin tools
ba88im 8a8e0d1
Merge origin/student_notes: per-student notes on user_to_courses
ba88im 8733a61
Merge origin/mass-approve-decline (PR #330): mass approve/decline UI …
ba88im a8934f3
Revert "fixed tests"
ba88im f0e6c49
Resolve schema conflict
ba88im File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| web: bundle exec rails server -p $PORT | ||
| worker: bundle exec good_job start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| class APITokensController < ApplicationController | ||
| before_action :authenticated! | ||
| before_action :authenticate_user | ||
| before_action :set_course | ||
| before_action :ensure_instructor_role | ||
| before_action :set_pending_request_count | ||
|
|
||
| def index | ||
| @api_tokens = @course.api_tokens.includes(:user).order(created_at: :desc) | ||
| end | ||
|
|
||
| def destroy | ||
| @api_token = @course.api_tokens.find_by(id: params[:id]) | ||
|
|
||
| if @api_token | ||
| @api_token.revoke! | ||
| redirect_to course_api_tokens_path(@course), notice: 'API token revoked successfully.' | ||
| else | ||
| redirect_to course_api_tokens_path(@course), alert: 'API token not found.' | ||
| end | ||
| end | ||
|
|
||
| private | ||
|
|
||
| def set_pending_request_count | ||
| @pending_requests_count = Request.where(course_id: @course&.id, status: 'pending').count | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note, I wonder if this endpoint should always return a CSV.
In the case of an error maybe it should return something like
This would make debugging things easier when they co wrong...