firebaserules.projects.test
POST {{baseUrl}}/v1/{{name}}:test?$.xgafv=<string>&access_token=<string>&alt=<string>&callback=<string>&fields=<string>&key=<string>&oauth_token=<string>&prettyPrint=<boolean>"aUser=<string>&upload_protocol=<string>&uploadType=<string>
Test Source
for syntactic and semantic correctness. Issues present, if any, will be returned to the caller with a description, severity, and source location. The test method may be executed with Source
or a Ruleset
name. Passing Source
is useful for unit testing new rules. Passing a Ruleset
name is useful for regression testing an existing rule. The following is an example of Source
that permits users to upload images to a bucket bearing their user id and matching the correct metadata: Example // Users are allowed to subscribe and unsubscribe to the blog. service firebase.storage { match /users/{userId}/images/{imageName} { allow write: if userId == request.auth.uid && (imageName.matches('.png$') || imageName.matches('.jpg$')) && resource.mimeType.matches('image/') } }
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
$.xgafv | string | V1 error format. | |
access_token | string | OAuth access token. | |
alt | string | Data format for response. | |
callback | string | JSONP | |
fields | string | Selector specifying which fields to include in a partial response. | |
key | string | API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. | |
oauth_token | string | OAuth 2.0 token for the current user. | |
prettyPrint | string | Returns response with indentations and line breaks. | |
quotaUser | string | Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. | |
upload_protocol | string | Upload protocol for media (e.g. "raw", "multipart"). | |
uploadType | string | Legacy upload protocol for media (e.g. "media", "multipart"). |
Request Body
{"source"=>{"files"=>[{"content"=>"in", "fingerprint"=>"amet aliqua", "name"=>"lab"}, {"content"=>"minim d", "fingerprint"=>"ea aliquip", "name"=>"laboris"}]}, "testSuite"=>{"testCases"=>[{"expectation"=>"<string>", "expressionReportLevel"=>"<string>", "functionMocks"=>[{"args"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "function"=>"<string>", "result"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}}, {"args"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "function"=>"<string>", "result"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}}], "pathEncoding"=>"<string>"}, {"expectation"=>"<string>", "expressionReportLevel"=>"<string>", "functionMocks"=>[{"args"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "function"=>"<string>", "result"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}}, {"args"=>[{"value"=>"<Error: Too many levels of nesting to fake this schema>"}, {"value"=>"<Error: Too many levels of nesting to fake this schema>"}], "function"=>"<string>", "result"=>{"value"=>"<Error: Too many levels of nesting to fake this schema>"}}], "pathEncoding"=>"<string>"}]}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
{"issues":[{"description":"consequat et minim amet","severity":"SEVERITY_UNSPECIFIED","sourcePosition":{"column":-24333018,"currentOffset":-70054847,"endOffset":-74657084,"fileName":"nulla veniam cupidatat in","line":-84400151}},{"description":"adipisicing in quis minim anim","severity":"WARNING","sourcePosition":{"column":-54700024,"currentOffset":90537493,"endOffset":35802054,"fileName":"sit culpa","line":-32201766}}],"testResults":[{"debugMessages":["Ut consequat id","enim nisi"],"errorPosition":{"column":-57715626,"currentOffset":-20207326,"endOffset":-96682640,"fileName":"pariatur anim dolore esse","line":34757370},"expressionReports":[{"children":[{"value":"\u003cCircular reference to #/components/schemas/ExpressionReport detected\u003e"},{"value":"\u003cCircular reference to #/components/schemas/ExpressionReport detected\u003e"}],"sourcePosition":{"column":-91586767,"currentOffset":29155892,"endOffset":26040005,"fileName":"enim aute consectetur","line":10234184},"values":[{"count":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"value":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},{"count":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"value":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}}]},{"children":[{"value":"\u003cCircular reference to #/components/schemas/ExpressionReport detected\u003e"},{"value":"\u003cCircular reference to #/components/schemas/ExpressionReport detected\u003e"}],"sourcePosition":{"column":-42009335,"currentOffset":70430622,"endOffset":85809474,"fileName":"sit Lorem quis cupidatat non","line":-5479646},"values":[{"count":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"value":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},{"count":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"value":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}}]}],"functionCalls":[{"function":"ut reprehenderit"},{"function":"veniam aliqua dolore dolore"}],"state":"FAILURE","visitedExpressions":[{"sourcePosition":{"column":-83926308,"currentOffset":98241976,"endOffset":90875942,"fileName":"ut est dolore","line":30027083},"value":{}},{"sourcePosition":{"column":74571617,"currentOffset":51005806,"endOffset":-71593396,"fileName":"quis dolore nisi ve","line":-32764863},"value":{}}]},{"debugMessages":["quis veniam Excepteur","sed commodo consequat reprehenderit"],"errorPosition":{"column":-51665709,"currentOffset":-42073200,"endOffset":32987214,"fileName":"incididunt cupidatat adipisicing","line":-22961905},"expressionReports":[{"children":[{"value":"\u003cCircular reference to #/components/schemas/ExpressionReport detected\u003e"},{"value":"\u003cCircular reference to #/components/schemas/ExpressionReport detected\u003e"}],"sourcePosition":{"column":-25511998,"currentOffset":-51530392,"endOffset":-81484881,"fileName":"nulla ut esse","line":50936218},"values":[{"count":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"value":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},{"count":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"value":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}}]},{"children":[{"value":"\u003cCircular reference to #/components/schemas/ExpressionReport detected\u003e"},{"value":"\u003cCircular reference to #/components/schemas/ExpressionReport detected\u003e"}],"sourcePosition":{"column":-944288,"currentOffset":-22090166,"endOffset":33551649,"fileName":"in sint","line":43030136},"values":[{"count":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"value":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}},{"count":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"},"value":{"value":"\u003cError: Too many levels of nesting to fake this schema\u003e"}}]}],"functionCalls":[{"function":"ad non laboris ullam"},{"function":"consequat Duis"}],"state":"SUCCESS","visitedExpressions":[{"sourcePosition":{"column":10883082,"currentOffset":22208853,"endOffset":46852503,"fileName":"deserunt elit nostrud in eiusmod","line":49519799},"value":{}},{"sourcePosition":{"column":48275376,"currentOffset":42426189,"endOffset":24846154,"fileName":"nulla eiusmod eu nostrud","line":96105676},"value":{}}]}]}