简体   繁体   English

在 Django + React webApp 中掩码 URL

[英]Mask URL in Django + React webApp

I want to share a page with clients over mail which is something like this:我想通过邮件与客户共享一个页面,如下所示:

https://blabla.com/docket/2443

but if I do so they can access all other pages by just changing the docket no.但如果我这样做,他们只需更改案卷编号即可访问所有其他页面。 ie 2443 in this case.即在这种情况下为2443 I tried to use tiny-url but it's of no use.我尝试使用tiny-url ,但它没有用。 Is there any way to mask the URL to solve the above problem?有没有什么办法屏蔽URL来解决上述问题?

There are multiple solutions to that problem.这个问题有多种解决方案。

  1. If that endpoint requires a login and related to a User , you can add permissions to that endpoint which makes it only accessible for the user(s) who are related to it.如果该端点需要登录并与User相关,您可以向该端点添加权限,使其仅可供与其相关的用户访问。

  2. If it is a public URL, You can make the id more sophisticated than an integer, you can make the id field a UUIDField , which makes it really hard to guess any other dockets ids.如果它是公共 URL,您可以使id比 integer 更复杂,您可以将 id 字段设置为UUIDField ,这使得很难猜测任何其他文档 ID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM