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

Fix project_id handling for RequestContext objects #102

Merged
merged 3 commits into from
Nov 19, 2024

Conversation

notque
Copy link
Contributor

@notque notque commented Nov 15, 2024

The audit middleware was assuming all contexts were dictionary-like objects,
causing AttributeError when handling Ironic requests where context is a
RequestContext object. This change adds proper type checking to safely handle
both dictionary and object-style contexts.

Error fixed:
AttributeError: 'RequestContext' object has no attribute 'get'

@notque notque self-assigned this Nov 15, 2024
@notque
Copy link
Contributor Author

notque commented Nov 15, 2024

@joker-at-work Can I get a PR review here?

auditmiddleware/_api.py Outdated Show resolved Hide resolved
auditmiddleware/_api.py Outdated Show resolved Hide resolved
@notque
Copy link
Contributor Author

notque commented Nov 18, 2024

@joker-at-work added your reasonable, and important feedback. Please let me know if this is reasonable for you now.

@notque
Copy link
Contributor Author

notque commented Nov 18, 2024

Also @sandzwerg - if you can patch and deploy this so we can test, that would be great. I go on vacation until the end of the year on Wednesday, so there isn't a lot of time to sort through this.

@notque notque merged commit e1bca84 into master Nov 19, 2024
1 check passed
@notque notque deleted the ironic_support_request_context branch November 19, 2024 16:29
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.

3 participants