English 中文(简体)
• 如何限制用户在单体应用中通过URL进入公共文件夹
原标题:How to restrict user to access public folder through URL in angular application

我创建了一个网络应用程序,其结构如下:

  • app
  • assests
  • main.ts
  • index.html
  • styles.scss
  • styles

We have some configurational file inside assests directory. We want to restrict assests directory access from URL example: http:localhost:3000/assests/config.json

我们正在遵循小额信贷结构、多克和库韦涅斯。

问题回答

资产上的一切都将是公开的。 如果含有敏感信息,则将其储存在单独的一层或单元中。

在安吉斯,你不能直接限制通过URL在公共文件夹中查阅静态档案,因为这些档案由服务器直接提供,而不是通过安热。 然而,可以考虑几个工作领域:

Server Configuration: Configure your server to restrict access to certain files or folders. For example, if you’re using an Apache server, you can use a .htaccess file to restrict access.

Move Sensitive files: Movetive file out of the publicDirectory and services them through a Service-side script. 该书在送达档案之前可以检查认证或其他许可。

Angular Guards: While Angular guards can’t prevent access to static files, they can be used to protect routes and prevent unauthorized access to certain parts of your application.

Remember, security is a complex field and it’s important to understand the implications of any changes you make. Always test your application thoroughly to ensure that your security measures are working as expected





相关问题
HTTP call from Celery worker

I am running a Flask-Celery server in docker desktop Kubernetes. It uses a Redis Result Backend. I want to use a Celery Task to make an HTTP call to a program that might take a while. This program ...

Why my website cookies are not being set on my browser?

Hello I am developing a web app, with a microservices architecture. I am using golang (Fiber) on the backend and Next.js on the frontend. When I send a request from restaurant.quiqr.co/signin to api....

我如何终止Kubernetes的名称空间?

我正试图终止Kubernetes的名称空间。 过去,我uc切地遵循了在库韦涅斯这里发现的在终止地位方面摇摇摇欲坠的空地。

helm with if condition and its scope for the value set

I would like to overwrite the user template with .Values.userTemplate if it exist. But I always get $user as undefined when the .Vaues.userTemplate exist. If i remove if condition and use {{- $user := ...

热门标签