-
Notifications
You must be signed in to change notification settings - Fork 7
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
Adding various Canvas functions #33
Conversation
Lintrule is disabled.
|
This PR is being deployed to Railway 🚅 flask: ◻️ REMOVED |
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.
I didn’t test it, but the code structure & quality looks very nice.
How do we know we were successful?
Auth?
No event listeners on Canvas, so use cron job to do DAILY uploads. Diff mechanism (no file types considerations). import hashlib
def generate_checksum(file_path):
sha256_hash = hashlib.sha256()
with open(file_path, "rb") as file:
# Read and update the hash string value in blocks
for byte_block in iter(lambda: file.read(4096), b""):
sha256_hash.update(byte_block)
return sha256_hash.hexdigest() |
|
GitGuardian id | Secret | Commit | Filename | |
---|---|---|---|---|
7724259 | Supabase Service Role JWT | deceb15 | ai_ta_backend/nomic.ipynb | View secret |
7724259 | Supabase Service Role JWT | 07238a2 | ai_ta_backend/nomic.ipynb | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
Adding a link to the current Canvas apps on Illinois Canvas@Illinois, General LTI Integrations (uillinois.edu) |
|
We are now able to scrape all of the content in Canvas (syllabus, pages, etc.)! |
Wow fantastic, can we do a live demo on next meeting? |
Make sure to finish any details necessary so professors can start using it. Just LMK if you have any questions, the more questions the better. |
Current progress on the feature: Currently it exports all course content irrespective of whether anything is unpublished. I am working on creating a list of published content first and then passing it to the content export API, so only those files are exported. |
Shouldn’t it be fine? If the “student user” can see it, then it’s meant to
be seen?
…On Mon, Sep 18, 2023 at 3:15 PM Asmita Dabholkar ***@***.***> wrote:
Current progress on the feature: Currently it exports all course content
irrespective of whether anything is unpublished. I am working on creating a
list of published content first and then passing it to the content export
API, so only those files are exported.
—
Reply to this email directly, view it on GitHub
<#33 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADH2CNOVIDJ7FXD4FT4SC4DX3DBZDANCNFSM6AAAAAA3MDQF5A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Selective content export yes! I was trying exactly that before Kastan suggested the individual files route. I have uiuc.chat as a user in the course. I have the bearer token set. But the |
Oh, by teacher I don't mean the course creators. I am referring to using the UIUC Chat account which professors will add to their course. Instead of adding it as a student, I was adding it as a teacher. |
@KastanDay I have updated the ingest and add_users functions here. |
Hi @star-nox, do you think any of this is ready for testing & review? I'd love to get an MVP live ASAP so I can give it to George to better understand what users will want. Thanks. |
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.
Needs a minor change to update_files()
, see below
I was facing some JSON error when I passed this dictionary as a parameter in the API call. It is supposed to come from the front-end. For now I have hardcoded it into the function - it ingests all of the below things. It works well for now though, you can test it.
|
@KastanDay |
ai_ta_backend/update_materials.py
Outdated
|
||
|
||
# Access checksum of s3 files | ||
s3_client = boto3.client('s3', aws_access_key_id=os.getenv('AWS_ACCESS_KEY_ID'), |
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.
Hmm, this is really expensive to download all files from S3.
In the end, it's the exact same as using the Document Contexts
from Supabase SQL. I think we have to re-implement this with Supabase instead of S3. It'll be hundreds of times faster and cheaper and probably conceptually simpler too.
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.
Oh okay. I thought get_object()
just reads the files without downloading them. I use it to access the ETag
attribute which is the md5 hash of the file.
Won't the Supabase contexts give us a different checksum than the original non-manipulated file?
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.
Changes requested in main & update_materials.
@KastanDay I have separated the file update functions into a different PR. This one now contains the |
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.
Fully working in my end-to-end testing. Merging!
added function for getting canvas user emails
Here's our development course: https://canvas.illinois.edu/courses/37348