变化1:
file.jsp?parameter1=¶meter2=abc
Run Code Online (Sandbox Code Playgroud)
变化2:
file.jsp?parameter1¶meter2=abc
Run Code Online (Sandbox Code Playgroud)
我知道Variation 1被认为是有效的,但变体2被认为是有效的吗?具体来说,参数没有值,在这种情况下是否需要等号?
我使用 Web / JS SDK 和 Firebase 身份验证来对用户进行身份验证(使用电话号码),然后尝试创建一个具有适当安全规则的 Firestore 文档(也使用 Web SDK)。但是,尽管经过身份验证,每个安全规则都会失败,因为请求身份验证由于某种原因为空。在下面的示例中,我尝试创建一个 ID 等于经过身份验证的用户的 uid(由 Firebase 生成)的文档。本例中的 uid 是pbc5l8cca7ELtwM0Kxctn9xLeT2i(它在调试日志记录中可见)。
我的规则:
service cloud.firestore {
match /databases/{database}/documents {
// Allow only authenticated content owners access
match /preferences/{userId} {
allow read, update: if debug(request.auth) != null && debug(request.auth.uid) == userId;
allow create: if debug(request) && debug(request.auth) != null;
}
Run Code Online (Sandbox Code Playgroud)
该行的调试allow create正在打印出请求,奇怪的是标头中有一个承载令牌(如果我在未经身份验证的情况下尝试相同的操作,则该令牌会丢失),但请求的 auth 属性为空。
Apr 16, 2021 6:20:42 PM io.gapi.emulators.netty.HttpVersionRoutingHandler channelRead
INFO: Detected non-HTTP/2 connection.
Apr 16, 2021 6:20:42 PM …Run Code Online (Sandbox Code Playgroud) firebase firebase-security firebase-authentication google-cloud-firestore