blob: b4ad4d9d3c97900373eb45e78c87c2bd8e8c992d [file] [log] [blame] [edit]
{
"canonicalName": "Firebase Rules",
"id": "firebaserules:v1",
"servicePath": "",
"discoveryVersion": "v1",
"protocol": "rest",
"rootUrl": "https://firebaserules.googleapis.com/",
"ownerDomain": "google.com",
"fullyEncodeReservedExpansion": true,
"version_module": true,
"title": "Firebase Rules API",
"description": "Creates and manages rules that determine when a Firebase Rules-enabled service should permit a request. ",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"resources": {
"projects": {
"resources": {
"rulesets": {
"methods": {
"list": {
"httpMethod": "GET",
"flatPath": "v1/projects/{projectsId}/rulesets",
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/firebase",
"https://www.googleapis.com/auth/firebase.readonly"
],
"parameters": {
"filter": {
"location": "query",
"type": "string",
"description": "`Ruleset` filter. The list method supports filters with restrictions on `Ruleset.name`. Filters on `Ruleset.create_time` should use the `date` function which parses strings that conform to the RFC 3339 date/time specifications. Example: `create_time \u003e date(\"2017-01-01T00:00:00Z\") AND name=UUID-*`"
},
"name": {
"required": true,
"pattern": "^projects/[^/]+$",
"description": "Resource name for the project. Format: `projects/{project_id}`",
"type": "string",
"location": "path"
},
"pageSize": {
"location": "query",
"type": "integer",
"format": "int32",
"description": "Page size to load. Maximum of 100. Defaults to 10. Note: `page_size` is just a hint and the service may choose to load less than `page_size` due to the size of the output. To traverse all of the releases, caller should iterate until the `page_token` is empty."
},
"pageToken": {
"location": "query",
"description": "Next page token for loading the next batch of `Ruleset` instances.",
"type": "string"
}
},
"description": "List `Ruleset` metadata only and optionally filter the results by `Ruleset` name. The full `Source` contents of a `Ruleset` may be retrieved with GetRuleset.",
"parameterOrder": [
"name"
],
"id": "firebaserules.projects.rulesets.list",
"path": "v1/{+name}/rulesets",
"response": {
"$ref": "ListRulesetsResponse"
}
},
"delete": {
"path": "v1/{+name}",
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/firebase"
],
"parameterOrder": [
"name"
],
"description": "Delete a `Ruleset` by resource name. If the `Ruleset` is referenced by a `Release` the operation will fail.",
"flatPath": "v1/projects/{projectsId}/rulesets/{rulesetsId}",
"id": "firebaserules.projects.rulesets.delete",
"response": {
"$ref": "Empty"
},
"httpMethod": "DELETE",
"parameters": {
"name": {
"location": "path",
"required": true,
"description": "Resource name for the ruleset to delete. Format: `projects/{project_id}/rulesets/{ruleset_id}`",
"type": "string",
"pattern": "^projects/[^/]+/rulesets/[^/]+$"
}
}
},
"create": {
"flatPath": "v1/projects/{projectsId}/rulesets",
"httpMethod": "POST",
"response": {
"$ref": "Ruleset"
},
"id": "firebaserules.projects.rulesets.create",
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/firebase"
],
"parameterOrder": [
"name"
],
"path": "v1/{+name}/rulesets",
"description": "Create a `Ruleset` from `Source`. The `Ruleset` is given a unique generated name which is returned to the caller. `Source` containing syntactic or semantics errors will result in an error response indicating the first error encountered. For a detailed view of `Source` issues, use TestRuleset.",
"parameters": {
"name": {
"required": true,
"description": "Resource name for Project which owns this `Ruleset`. Format: `projects/{project_id}`",
"pattern": "^projects/[^/]+$",
"location": "path",
"type": "string"
}
},
"request": {
"$ref": "Ruleset"
}
},
"get": {
"flatPath": "v1/projects/{projectsId}/rulesets/{rulesetsId}",
"description": "Get a `Ruleset` by name including the full `Source` contents.",
"httpMethod": "GET",
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/firebase",
"https://www.googleapis.com/auth/firebase.readonly"
],
"parameters": {
"name": {
"pattern": "^projects/[^/]+/rulesets/[^/]+$",
"type": "string",
"description": "Resource name for the ruleset to get. Format: `projects/{project_id}/rulesets/{ruleset_id}`",
"location": "path",
"required": true
}
},
"path": "v1/{+name}",
"response": {
"$ref": "Ruleset"
},
"parameterOrder": [
"name"
],
"id": "firebaserules.projects.rulesets.get"
}
}
},
"releases": {
"methods": {
"patch": {
"id": "firebaserules.projects.releases.patch",
"request": {
"$ref": "UpdateReleaseRequest"
},
"httpMethod": "PATCH",
"response": {
"$ref": "Release"
},
"parameters": {
"name": {
"required": true,
"pattern": "^projects/[^/]+/releases/.*$",
"type": "string",
"location": "path",
"description": "Resource name for the project which owns this `Release`. Format: `projects/{project_id}`"
}
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/firebase"
],
"flatPath": "v1/projects/{projectsId}/releases/{releasesId}",
"path": "v1/{+name}",
"description": "Update a `Release` via PATCH. Only updates to the `ruleset_name` and `test_suite_name` fields will be honored. `Release` rename is not supported. To create a `Release` use the CreateRelease method.",
"parameterOrder": [
"name"
]
},
"delete": {
"path": "v1/{+name}",
"httpMethod": "DELETE",
"response": {
"$ref": "Empty"
},
"parameterOrder": [
"name"
],
"description": "Delete a `Release` by resource name.",
"flatPath": "v1/projects/{projectsId}/releases/{releasesId}",
"parameters": {
"name": {
"pattern": "^projects/[^/]+/releases/.*$",
"required": true,
"description": "Resource name for the `Release` to delete. Format: `projects/{project_id}/releases/{release_id}`",
"location": "path",
"type": "string"
}
},
"id": "firebaserules.projects.releases.delete",
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/firebase"
]
},
"create": {
"description": "Create a `Release`. Release names should reflect the developer's deployment practices. For example, the release name may include the environment name, application name, application version, or any other name meaningful to the developer. Once a `Release` refers to a `Ruleset`, the rules can be enforced by Firebase Rules-enabled services. More than one `Release` may be 'live' concurrently. Consider the following three `Release` names for `projects/foo` and the `Ruleset` to which they refer. Release Name | Ruleset Name --------------------------------|------------- projects/foo/releases/prod | projects/foo/rulesets/uuid123 projects/foo/releases/prod/beta | projects/foo/rulesets/uuid123 projects/foo/releases/prod/v23 | projects/foo/rulesets/uuid456 The table reflects the `Ruleset` rollout in progress. The `prod` and `prod/beta` releases refer to the same `Ruleset`. However, `prod/v23` refers to a new `Ruleset`. The `Ruleset` reference for a `Release` may be updated using the UpdateRelease method.",
"parameters": {
"name": {
"required": true,
"location": "path",
"description": "Resource name for the project which owns this `Release`. Format: `projects/{project_id}`",
"type": "string",
"pattern": "^projects/[^/]+$"
}
},
"request": {
"$ref": "Release"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/firebase"
],
"path": "v1/{+name}/releases",
"parameterOrder": [
"name"
],
"response": {
"$ref": "Release"
},
"flatPath": "v1/projects/{projectsId}/releases",
"httpMethod": "POST",
"id": "firebaserules.projects.releases.create"
},
"getExecutable": {
"id": "firebaserules.projects.releases.getExecutable",
"httpMethod": "GET",
"response": {
"$ref": "GetReleaseExecutableResponse"
},
"parameterOrder": [
"name"
],
"description": "Get the `Release` executable to use when enforcing rules.",
"parameters": {
"name": {
"location": "path",
"type": "string",
"pattern": "^projects/[^/]+/releases/.*$",
"required": true,
"description": "Resource name of the `Release`. Format: `projects/{project_id}/releases/{release_id}`"
},
"executableVersion": {
"enumDescriptions": [
"Executable format unspecified. Defaults to FIREBASE_RULES_EXECUTABLE_V1",
"Firebase Rules syntax 'rules2' executable versions: Custom AST for use with Java clients.",
"CEL-based executable for use with C++ clients."
],
"location": "query",
"enum": [
"RELEASE_EXECUTABLE_VERSION_UNSPECIFIED",
"FIREBASE_RULES_EXECUTABLE_V1",
"FIREBASE_RULES_EXECUTABLE_V2"
],
"description": "The requested runtime executable version. Defaults to FIREBASE_RULES_EXECUTABLE_V1.",
"type": "string"
}
},
"path": "v1/{+name}:getExecutable",
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/firebase",
"https://www.googleapis.com/auth/firebase.readonly"
],
"flatPath": "v1/projects/{projectsId}/releases/{releasesId}:getExecutable"
},
"list": {
"parameterOrder": [
"name"
],
"description": "List the `Release` values for a project. This list may optionally be filtered by `Release` name, `Ruleset` name, `TestSuite` name, or any combination thereof.",
"path": "v1/{+name}/releases",
"id": "firebaserules.projects.releases.list",
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/firebase",
"https://www.googleapis.com/auth/firebase.readonly"
],
"response": {
"$ref": "ListReleasesResponse"
},
"flatPath": "v1/projects/{projectsId}/releases",
"parameters": {
"name": {
"description": "Resource name for the project. Format: `projects/{project_id}`",
"location": "path",
"required": true,
"pattern": "^projects/[^/]+$",
"type": "string"
},
"pageSize": {
"type": "integer",
"format": "int32",
"description": "Page size to load. Maximum of 100. Defaults to 10. Note: `page_size` is just a hint and the service may choose to load fewer than `page_size` results due to the size of the output. To traverse all of the releases, the caller should iterate until the `page_token` on the response is empty.",
"location": "query"
},
"filter": {
"description": "`Release` filter. The list method supports filters with restrictions on the `Release.name`, `Release.ruleset_name`, and `Release.test_suite_name`. Example 1: A filter of 'name=prod*' might return `Release`s with names within 'projects/foo' prefixed with 'prod': Name | Ruleset Name ------------------------------|------------- projects/foo/releases/prod | projects/foo/rulesets/uuid1234 projects/foo/releases/prod/v1 | projects/foo/rulesets/uuid1234 projects/foo/releases/prod/v2 | projects/foo/rulesets/uuid8888 Example 2: A filter of `name=prod* ruleset_name=uuid1234` would return only `Release` instances for 'projects/foo' with names prefixed with 'prod' referring to the same `Ruleset` name of 'uuid1234': Name | Ruleset Name ------------------------------|------------- projects/foo/releases/prod | projects/foo/rulesets/1234 projects/foo/releases/prod/v1 | projects/foo/rulesets/1234 In the examples, the filter parameters refer to the search filters are relative to the project. Fully qualified prefixed may also be used. e.g. `test_suite_name=projects/foo/testsuites/uuid1`",
"location": "query",
"type": "string"
},
"pageToken": {
"type": "string",
"description": "Next page token for the next batch of `Release` instances.",
"location": "query"
}
},
"httpMethod": "GET"
},
"get": {
"flatPath": "v1/projects/{projectsId}/releases/{releasesId}",
"response": {
"$ref": "Release"
},
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"required": true,
"type": "string",
"pattern": "^projects/[^/]+/releases/.*$",
"description": "Resource name of the `Release`. Format: `projects/{project_id}/releases/{release_id}`",
"location": "path"
}
},
"id": "firebaserules.projects.releases.get",
"httpMethod": "GET",
"description": "Get a `Release` by name.",
"path": "v1/{+name}",
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/firebase",
"https://www.googleapis.com/auth/firebase.readonly"
]
}
}
}
},
"methods": {
"test": {
"parameterOrder": [
"name"
],
"description": "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/') } }",
"parameters": {
"name": {
"required": true,
"pattern": "^projects/.*$",
"description": "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}`",
"location": "path",
"type": "string"
}
},
"flatPath": "v1/projects/{projectsId}:test",
"path": "v1/{+name}:test",
"request": {
"$ref": "TestRulesetRequest"
},
"response": {
"$ref": "TestRulesetResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/firebase",
"https://www.googleapis.com/auth/firebase.readonly"
],
"id": "firebaserules.projects.test",
"httpMethod": "POST"
}
}
}
},
"documentationLink": "https://firebase.google.com/docs/storage/security",
"schemas": {
"GetReleaseExecutableResponse": {
"type": "object",
"properties": {
"syncTime": {
"format": "google-datetime",
"description": "Optional, indicates the freshness of the result. The response is guaranteed to be the latest within an interval up to the sync_time (inclusive).",
"type": "string"
},
"updateTime": {
"description": "Timestamp for the most recent `Release.update_time`.",
"type": "string",
"format": "google-datetime"
},
"executableVersion": {
"enumDescriptions": [
"Executable format unspecified. Defaults to FIREBASE_RULES_EXECUTABLE_V1",
"Firebase Rules syntax 'rules2' executable versions: Custom AST for use with Java clients.",
"CEL-based executable for use with C++ clients."
],
"type": "string",
"description": "The Rules runtime version of the executable.",
"enum": [
"RELEASE_EXECUTABLE_VERSION_UNSPECIFIED",
"FIREBASE_RULES_EXECUTABLE_V1",
"FIREBASE_RULES_EXECUTABLE_V2"
]
},
"language": {
"description": "`Language` used to generate the executable bytes.",
"enumDescriptions": [
"Language unspecified. Defaults to FIREBASE_RULES.",
"Firebase Rules language.",
"Event Flow triggers."
],
"type": "string",
"enum": [
"LANGUAGE_UNSPECIFIED",
"FIREBASE_RULES",
"EVENT_FLOW_TRIGGERS"
]
},
"executable": {
"description": "Executable view of the `Ruleset` referenced by the `Release`.",
"type": "string",
"format": "byte"
},
"rulesetName": {
"type": "string",
"description": "`Ruleset` name associated with the `Release` executable."
}
},
"id": "GetReleaseExecutableResponse",
"description": "The response for FirebaseRulesService.GetReleaseExecutable"
},
"ListRulesetsResponse": {
"description": "The response for FirebaseRulesService.ListRulesets.",
"type": "object",
"properties": {
"rulesets": {
"items": {
"$ref": "Ruleset"
},
"description": "List of `Ruleset` instances.",
"type": "array"
},
"nextPageToken": {
"description": "The pagination token to retrieve the next page of results. If the value is empty, no further results remain.",
"type": "string"
}
},
"id": "ListRulesetsResponse"
},
"Arg": {
"type": "object",
"id": "Arg",
"description": "Arg matchers for the mock function.",
"properties": {
"exactValue": {
"type": "any",
"description": "Argument exactly matches value provided."
},
"anyValue": {
"description": "Argument matches any value provided.",
"$ref": "Empty"
}
}
},
"ExpressionReport": {
"id": "ExpressionReport",
"description": "Describes where in a file an expression is found and what it was evaluated to over the course of its use.",
"type": "object",
"properties": {
"sourcePosition": {
"description": "Position of expression in original rules source.",
"$ref": "SourcePosition"
},
"values": {
"description": "Values that this expression evaluated to when encountered.",
"type": "array",
"items": {
"$ref": "ValueCount"
}
},
"children": {
"description": "Subexpressions",
"items": {
"$ref": "ExpressionReport"
},
"type": "array"
}
}
},
"VisitedExpression": {
"id": "VisitedExpression",
"type": "object",
"description": "Store the position and access outcome for an expression visited in rules.",
"properties": {
"sourcePosition": {
"description": "Position in the `Source` or `Ruleset` where an expression was visited.",
"$ref": "SourcePosition"
},
"value": {
"description": "The evaluated value for the visited expression, e.g. true/false",
"type": "any"
}
}
},
"Release": {
"properties": {
"createTime": {
"type": "string",
"format": "google-datetime",
"description": "Time the release was created. Output only."
},
"updateTime": {
"type": "string",
"format": "google-datetime",
"description": "Time the release was updated. Output only."
},
"name": {
"description": "Resource name for the `Release`. `Release` names may be structured `app1/prod/v2` or flat `app1_prod_v2` which affords developers a great deal of flexibility in mapping the name to the style that best fits their existing development practices. For example, a name could refer to an environment, an app, a version, or some combination of three. In the table below, for the project name `projects/foo`, the following relative release paths show how flat and structured names might be chosen to match a desired development / deployment strategy. Use Case | Flat Name | Structured Name -------------|---------------------|---------------- Environments | releases/qa | releases/qa Apps | releases/app1_qa | releases/app1/qa Versions | releases/app1_v2_qa | releases/app1/v2/qa The delimiter between the release name path elements can be almost anything and it should work equally well with the release name list filter, but in many ways the structured paths provide a clearer picture of the relationship between `Release` instances. Format: `projects/{project_id}/releases/{release_id}`",
"type": "string"
},
"rulesetName": {
"type": "string",
"description": "Name of the `Ruleset` referred to by this `Release`. The `Ruleset` must exist the `Release` to be created."
}
},
"description": "`Release` is a named reference to a `Ruleset`. Once a `Release` refers to a `Ruleset`, rules-enabled services will be able to enforce the `Ruleset`.",
"type": "object",
"id": "Release"
},
"TestRulesetResponse": {
"properties": {
"testResults": {
"description": "The set of test results given the test cases in the `TestSuite`. The results will appear in the same order as the test cases appear in the `TestSuite`.",
"type": "array",
"items": {
"$ref": "TestResult"
}
},
"issues": {
"description": "Syntactic and semantic `Source` issues of varying severity. Issues of `ERROR` severity will prevent tests from executing.",
"type": "array",
"items": {
"$ref": "Issue"
}
}
},
"description": "The response for FirebaseRulesService.TestRuleset.",
"type": "object",
"id": "TestRulesetResponse"
},
"FunctionMock": {
"type": "object",
"description": "Mock function definition. Mocks must refer to a function declared by the target service. The type of the function args and result will be inferred at test time. If either the arg or result values are not compatible with function type declaration, the request will be considered invalid. More than one `FunctionMock` may be provided for a given function name so long as the `Arg` matchers are distinct. There may be only one function for a given overload where all `Arg` values are `Arg.any_value`.",
"properties": {
"args": {
"type": "array",
"items": {
"$ref": "Arg"
},
"description": "The list of `Arg` values to match. The order in which the arguments are provided is the order in which they must appear in the function invocation."
},
"function": {
"description": "The name of the function. The function name must match one provided by a service declaration.",
"type": "string"
},
"result": {
"$ref": "Result",
"description": "The mock result of the function call."
}
},
"id": "FunctionMock"
},
"FunctionCall": {
"id": "FunctionCall",
"type": "object",
"description": "Represents a service-defined function call that was invoked during test execution.",
"properties": {
"function": {
"description": "Name of the function invoked.",
"type": "string"
},
"args": {
"items": {
"type": "any"
},
"description": "The arguments that were provided to the function.",
"type": "array"
}
}
},
"SourcePosition": {
"properties": {
"column": {
"type": "integer",
"format": "int32",
"description": "First column on the source line associated with the source fragment."
},
"currentOffset": {
"type": "integer",
"format": "int32",
"description": "Start position relative to the beginning of the file."
},
"line": {
"type": "integer",
"format": "int32",
"description": "Line number of the source fragment. 1-based."
},
"fileName": {
"type": "string",
"description": "Name of the `File`."
},
"endOffset": {
"format": "int32",
"description": "End position relative to the beginning of the file.",
"type": "integer"
}
},
"id": "SourcePosition",
"description": "Position in the `Source` content including its line, column number, and an index of the `File` in the `Source` message. Used for debug purposes.",
"type": "object"
},
"TestRulesetRequest": {
"type": "object",
"description": "The request for FirebaseRulesService.TestRuleset.",
"properties": {
"source": {
"description": "Optional `Source` to be checked for correctness. This field must not be set when the resource name refers to a `Ruleset`.",
"$ref": "Source"
},
"testSuite": {
"$ref": "TestSuite",
"description": "Inline `TestSuite` to run."
}
},
"id": "TestRulesetRequest"
},
"UpdateReleaseRequest": {
"id": "UpdateReleaseRequest",
"type": "object",
"properties": {
"updateMask": {
"type": "string",
"format": "google-fieldmask",
"description": "Specifies which fields to update."
},
"release": {
"$ref": "Release",
"description": "`Release` to update."
}
},
"description": "The request for FirebaseRulesService.UpdateReleasePatch."
},
"Source": {
"description": "`Source` is one or more `File` messages comprising a logical set of rules.",
"type": "object",
"id": "Source",
"properties": {
"files": {
"items": {
"$ref": "File"
},
"type": "array",
"description": "`File` set constituting the `Source` bundle."
}
}
},
"TestResult": {
"type": "object",
"description": "Test result message containing the state of the test as well as a description and source position for test failures.",
"properties": {
"debugMessages": {
"description": "Debug messages related to test execution issues encountered during evaluation. Debug messages may be related to too many or too few invocations of function mocks or to runtime errors that occur during evaluation. For example: ```Unable to read variable [name: \"resource\"]```",
"items": {
"type": "string"
},
"type": "array"
},
"functionCalls": {
"description": "The set of function calls made to service-defined methods. Function calls are included in the order in which they are encountered during evaluation, are provided for both mocked and unmocked functions, and included on the response regardless of the test `state`.",
"type": "array",
"items": {
"$ref": "FunctionCall"
}
},
"state": {
"enum": [
"STATE_UNSPECIFIED",
"SUCCESS",
"FAILURE"
],
"description": "State of the test.",
"enumDescriptions": [
"Test state is not set.",
"Test is a success.",
"Test is a failure."
],
"type": "string"
},
"errorPosition": {
"$ref": "SourcePosition",
"description": "Position in the `Source` or `Ruleset` where the principle runtime error occurs. Evaluation of an expression may result in an error. Rules are deny by default, so a `DENY` expectation when an error is generated is valid. When there is a `DENY` with an error, the `SourcePosition` is returned. E.g. `error_position { line: 19 column: 37 }`"
},
"visitedExpressions": {
"description": "The set of visited permission expressions for a given test. This returns the positions and evaluation results of all visited permission expressions which were relevant to the test case, e.g. ``` match /path { allow read if: } ``` For a detailed report of the intermediate evaluation states, see the `expression_reports` field",
"type": "array",
"items": {
"$ref": "VisitedExpression"
}
},
"expressionReports": {
"description": "The mapping from expression in the ruleset AST to the values they were evaluated to. Partially-nested to mirror AST structure. Note that this field is actually tracking expressions and not permission statements in contrast to the \"visited_expressions\" field above. Literal expressions are omitted.",
"type": "array",
"items": {
"$ref": "ExpressionReport"
}
}
},
"id": "TestResult"
},
"ValueCount": {
"id": "ValueCount",
"type": "object",
"properties": {
"count": {
"type": "integer",
"description": "The amount of times that expression returned.",
"format": "int32"
},
"value": {
"description": "The return value of the expression",
"type": "any"
}
},
"description": "Tuple for how many times an Expression was evaluated to a particular ExpressionValue."
},
"TestCase": {
"id": "TestCase",
"type": "object",
"properties": {
"expressionReportLevel": {
"description": "Specifies what should be included in the response.",
"enumDescriptions": [
"No level has been specified. Defaults to \"NONE\" behavior.",
"Do not include any additional information.",
"Include detailed reporting on expressions evaluated.",
"Only include the expressions that were visited during evaluation."
],
"enum": [
"LEVEL_UNSPECIFIED",
"NONE",
"FULL",
"VISITED"
],
"type": "string"
},
"resource": {
"description": "Optional resource value as it appears in persistent storage before the request is fulfilled. The resource type depends on the `request.path` value.",
"type": "any"
},
"functionMocks": {
"description": "Optional function mocks for service-defined functions. If not set, any service defined function is expected to return an error, which may or may not influence the test outcome.",
"items": {
"$ref": "FunctionMock"
},
"type": "array"
},
"request": {
"description": "Request context. The exact format of the request context is service-dependent. See the appropriate service documentation for information about the supported fields and types on the request. Minimally, all services support the following fields and types: Request field | Type ---------------|----------------- auth.uid | `string` auth.token | `map` headers | `map` method | `string` params | `map` path | `string` time | `google.protobuf.Timestamp` If the request value is not well-formed for the service, the request will be rejected as an invalid argument.",
"type": "any"
},
"expectation": {
"enumDescriptions": [
"Unspecified expectation.",
"Expect an allowed result.",
"Expect a denied result."
],
"description": "Test expectation.",
"type": "string",
"enum": [
"EXPECTATION_UNSPECIFIED",
"ALLOW",
"DENY"
]
},
"pathEncoding": {
"type": "string",
"description": "Specifies whether paths (such as request.path) are encoded and how.",
"enumDescriptions": [
"No encoding has been specified. Defaults to \"URL_ENCODED\" behavior.",
"Treats path segments as URL encoded but with non-encoded separators (\"/\"). This is the default behavior.",
"Treats total path as non-URL encoded e.g. raw."
],
"enum": [
"ENCODING_UNSPECIFIED",
"URL_ENCODED",
"PLAIN"
]
}
},
"description": "`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."
},
"Metadata": {
"id": "Metadata",
"properties": {
"services": {
"description": "Services that this ruleset has declarations for (e.g., \"cloud.firestore\"). There may be 0+ of these.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object",
"description": "Metadata for a Ruleset."
},
"ListReleasesResponse": {
"id": "ListReleasesResponse",
"type": "object",
"properties": {
"nextPageToken": {
"description": "The pagination token to retrieve the next page of results. If the value is empty, no further results remain.",
"type": "string"
},
"releases": {
"items": {
"$ref": "Release"
},
"type": "array",
"description": "List of `Release` instances."
}
},
"description": "The response for FirebaseRulesService.ListReleases."
},
"Ruleset": {
"type": "object",
"properties": {
"source": {
"$ref": "Source",
"description": "`Source` for the `Ruleset`."
},
"createTime": {
"type": "string",
"format": "google-datetime",
"description": "Time the `Ruleset` was created. Output only."
},
"name": {
"description": "Name of the `Ruleset`. The ruleset_id is auto generated by the service. Format: `projects/{project_id}/rulesets/{ruleset_id}` Output only.",
"type": "string"
},
"metadata": {
"description": "The metadata for this ruleset. Output only.",
"$ref": "Metadata"
}
},
"description": "`Ruleset` is an immutable copy of `Source` with a globally unique identifier and a creation time.",
"id": "Ruleset"
},
"Empty": {
"description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`.",
"properties": {},
"id": "Empty",
"type": "object"
},
"Result": {
"properties": {
"value": {
"description": "The result is an actual value. The type of the value must match that of the type declared by the service.",
"type": "any"
},
"undefined": {
"description": "The result is undefined, meaning the result could not be computed.",
"$ref": "Empty"
}
},
"description": "Possible result values from the function mock invocation.",
"id": "Result",
"type": "object"
},
"Issue": {
"type": "object",
"properties": {
"description": {
"type": "string",
"description": "Short error description."
},
"severity": {
"enum": [
"SEVERITY_UNSPECIFIED",
"DEPRECATION",
"WARNING",
"ERROR"
],
"enumDescriptions": [
"An unspecified severity.",
"Deprecation issue for statements and method that may no longer be supported or maintained.",
"Warnings such as: unused variables.",
"Errors such as: unmatched curly braces or variable redefinition."
],
"description": "The severity of the issue.",
"type": "string"
},
"sourcePosition": {
"description": "Position of the issue in the `Source`.",
"$ref": "SourcePosition"
}
},
"id": "Issue",
"description": "Issues include warnings, errors, and deprecation notices."
},
"TestSuite": {
"id": "TestSuite",
"description": "`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.",
"properties": {
"testCases": {
"description": "Collection of test cases associated with the `TestSuite`.",
"items": {
"$ref": "TestCase"
},
"type": "array"
}
},
"type": "object"
},
"File": {
"id": "File",
"type": "object",
"description": "`File` containing source content.",
"properties": {
"fingerprint": {
"type": "string",
"description": "Fingerprint (e.g. github sha) associated with the `File`.",
"format": "byte"
},
"name": {
"description": "File name.",
"type": "string"
},
"content": {
"description": "Textual Content.",
"type": "string"
}
}
}
},
"ownerName": "Google",
"basePath": "",
"mtlsRootUrl": "https://firebaserules.mtls.googleapis.com/",
"kind": "discovery#restDescription",
"parameters": {
"prettyPrint": {
"type": "boolean",
"default": "true",
"description": "Returns response with indentations and line breaks.",
"location": "query"
},
"access_token": {
"location": "query",
"description": "OAuth access token.",
"type": "string"
},
"uploadType": {
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"location": "query",
"type": "string"
},
"alt": {
"enumDescriptions": [
"Responses with Content-Type of application/json",
"Media download with context-dependent Content-Type",
"Responses with Content-Type of application/x-protobuf"
],
"enum": [
"json",
"media",
"proto"
],
"type": "string",
"description": "Data format for response.",
"default": "json",
"location": "query"
},
"key": {
"type": "string",
"location": "query",
"description": "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."
},
"$.xgafv": {
"enum": [
"1",
"2"
],
"description": "V1 error format.",
"type": "string",
"enumDescriptions": [
"v1 error format",
"v2 error format"
],
"location": "query"
},
"callback": {
"location": "query",
"description": "JSONP",
"type": "string"
},
"fields": {
"description": "Selector specifying which fields to include in a partial response.",
"location": "query",
"type": "string"
},
"oauth_token": {
"description": "OAuth 2.0 token for the current user.",
"location": "query",
"type": "string"
},
"upload_protocol": {
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"location": "query",
"type": "string"
},
"quotaUser": {
"location": "query",
"description": "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.",
"type": "string"
}
},
"batchPath": "batch",
"version": "v1",
"revision": "20200807",
"baseUrl": "https://firebaserules.googleapis.com/",
"name": "firebaserules",
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/firebase.readonly": {
"description": "View all your Firebase data and settings"
},
"https://www.googleapis.com/auth/cloud-platform": {
"description": "View and manage your data across Google Cloud Platform services"
},
"https://www.googleapis.com/auth/firebase": {
"description": "View and administer all your Firebase data and settings"
}
}
}
}
}