Skip to content

Commit

Permalink
feat(firebaserules): update the api
Browse files Browse the repository at this point in the history
#### firebaserules:v1

The following keys were added:
- schemas.Release.properties.createTime.readOnly (Total Keys: 1)
- schemas.Release.properties.updateTime.readOnly (Total Keys: 1)
- schemas.Ruleset.properties.createTime.readOnly (Total Keys: 1)
- schemas.Ruleset.properties.metadata.readOnly (Total Keys: 1)
- schemas.Ruleset.properties.name.readOnly (Total Keys: 1)
  • Loading branch information
yoshi-automation committed Jun 16, 2021
1 parent f5c1345 commit 7b20004
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 68 deletions.
4 changes: 2 additions & 2 deletions docs/dyn/firebaserules_v1.projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h3>Method Details</h3>
<pre>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 &amp;&amp; (imageName.matches(&#x27;*.png$&#x27;) || imageName.matches(&#x27;*.jpg$&#x27;)) &amp;&amp; resource.mimeType.matches(&#x27;^image/&#x27;) } }

Args:
name: string, Tests may either provide `source` or a `Ruleset` resource name. For tests against `source`, the resource name must refer to the project: Format: `projects/{project_id}` For tests against a `Ruleset`, this must be the `Ruleset` resource name: Format: `projects/{project_id}/rulesets/{ruleset_id}` (required)
name: string, Required. Tests may either provide `source` or a `Ruleset` resource name. For tests against `source`, the resource name must refer to the project: Format: `projects/{project_id}` For tests against a `Ruleset`, this must be the `Ruleset` resource name: Format: `projects/{project_id}/rulesets/{ruleset_id}` (required)
body: object, The request body.
The object takes the form of:

Expand All @@ -115,7 +115,7 @@ <h3>Method Details</h3>
},
],
},
&quot;testSuite&quot;: { # `TestSuite` is a collection of `TestCase` instances that validate the logical correctness of a `Ruleset`. The `TestSuite` may be referenced in-line within a `TestRuleset` invocation or as part of a `Release` object as a pre-release check. # Inline `TestSuite` to run.
&quot;testSuite&quot;: { # `TestSuite` is a collection of `TestCase` instances that validate the logical correctness of a `Ruleset`. The `TestSuite` may be referenced in-line within a `TestRuleset` invocation or as part of a `Release` object as a pre-release check. # The tests to execute against the `Source`. When `Source` is provided inline, the test cases will only be run if the `Source` is syntactically and semantically valid. Inline `TestSuite` to run.
&quot;testCases&quot;: [ # Collection of test cases associated with the `TestSuite`.
{ # `TestCase` messages provide the request context and an expectation as to whether the given context will be allowed or denied. Test cases may specify the `request`, `resource`, and `function_mocks` to mock a function call to a service-provided function. The `request` object represents context present at request-time. The `resource` is the value of the target resource as it appears in persistent storage before the request is executed.
&quot;expectation&quot;: &quot;A String&quot;, # Test expectation.
Expand Down
Loading

0 comments on commit 7b20004

Please sign in to comment.