[GSK-1623] Secure Giskard readonly demo space at Hugging Face Spaces#1355
Merged
kevinmessiaen merged 68 commits intomainfrom Sep 20, 2023
Merged
[GSK-1623] Secure Giskard readonly demo space at Hugging Face Spaces#1355kevinmessiaen merged 68 commits intomainfrom
kevinmessiaen merged 68 commits intomainfrom
Conversation
…-1623-secure-readonly-demo-space
Remove mutable static object to make SonarLint happy
Add feedback and reply creation APIs as deny exceptions. Fix fontend component state after failed submissions.
…-1623-secure-readonly-demo-space
Contributor
|
since we're sending some POST requests like Instead I suggest we do it on a DB level (more precisely at JPA). for example, if you define a class like import jakarta.persistence.PrePersist;
import jakarta.persistence.PreRemove;
import jakarta.persistence.PreUpdate;
public class ReadOnlyListener {
private boolean isReadOnlyGiskardInstance() {
// TODO: implement this, probably in another class
return true;
}
@PrePersist
@PreUpdate
@PreRemove
void onCUD(Object o) {
if (isReadOnlyGiskardInstance()) {
throw new IllegalStateException("This is a read-only Giskard instance. You cannot modify entities.");
}
}
}Then you'll be able to use it at an @Entity(name = "api_keys")
@Getter
@NoArgsConstructor
@EntityListeners(ReadOnlyListener.class)
public class ApiKey extends AbstractAuditingEntityIn this case we could even allow some modifications but not others, like writing |
…skard Gallery instance
Letting MLWorker in HF connect
…-1623-secure-readonly-demo-space
|
Kudos, SonarCloud Quality Gate passed! |
…-1623-secure-readonly-demo-space
…-1623-secure-readonly-demo-space
…-1623-secure-readonly-demo-space
…-1623-secure-readonly-demo-space
kevinmessiaen
requested changes
Sep 18, 2023
…-1623-secure-readonly-demo-space
Co-authored-by: Kevin Messiaen <114553769+kevinmessiaen@users.noreply.github.com>
…-1623-secure-readonly-demo-space
|
Kudos, SonarCloud Quality Gate passed! |
1 similar comment
|
Kudos, SonarCloud Quality Gate passed! |
kevinmessiaen
approved these changes
Sep 20, 2023
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.









Description
Preventing any requests with modifications (POST, PUT, DELETE) whengiskardai/giskarddetected.Preventing Create, Update, Delete operations in DB after initialization.
Related Issue
Type of Change
Checklist
CODE_OF_CONDUCT.mddocument.CONTRIBUTING.mdguide.make codestyle.