I want to create a secure script that grants access to files based on specific conditions. The access should be controlled by both time-based and API-based conditions. The script should only allow file access if:
- A specific query from an API returns true.
- The current time is within a predefined range.
Additionally, the script must ensure that users cannot access the files directly and can only do so through the script. Here are the key requirements:
- Time-Based Condition: Access should only be allowed during a specified time range.
- API-Based Condition: Access should only be granted if a certain condition from an API response is met.
- Security Measures: Users should not be able to bypass the script to access the files directly.
Questions:
- How should I design this script to ensure it checks both time-based and API-based conditions before granting access to files?
- What security measures should I implement to ensure that the files can only be accessed through this script and not directly by the user?
- How can I obfuscate this code to prevent users from modifying it and bypassing the system?
Environment:
- Operating System: Windows 11
New contributor
edge selcuk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1