| 787 | } |
| 788 | |
| 789 | func checkMongoDBRequestBlocked(analysis *parserbase.MongoDBAnalysis) error { |
| 790 | if analysis == nil { |
| 791 | return nil |
| 792 | } |
| 793 | if analysis.API == parserbase.MongoDBMaskableAPIUnsupportedRead { |
| 794 | operation := analysis.Operation |
| 795 | if operation == "" { |
| 796 | operation = "unknown" |
| 797 | } |
| 798 | if analysis.UnsupportedStage != "" { |
| 799 | return errors.Errorf("MongoDB aggregate() with stage %q on collection %q is not supported for dynamic masking. Supported operations are find(), findOne(), and aggregate() with shape-preserving stages only", analysis.UnsupportedStage, analysis.Collection) |
| 800 | } |
| 801 | return errors.Errorf("MongoDB operation %q on collection %q is not supported for dynamic masking in this release. Supported operations are find() and findOne()", operation+"()", analysis.Collection) |
| 802 | } |
| 803 | return nil |
| 804 | } |
| 805 | |
| 806 | // injectJoinedSchemas adds array-of-objects schemas for each $lookup/$graphLookup join |
| 807 | // into the source objectSchema so masking covers the joined field. |