Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porting Casbin-CPP to Real-Time Operating Systems (RTOS) #229

Open
hsluoyz opened this issue May 5, 2023 · 1 comment
Open

Porting Casbin-CPP to Real-Time Operating Systems (RTOS) #229

hsluoyz opened this issue May 5, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@hsluoyz
Copy link
Member

hsluoyz commented May 5, 2023

Is your feature request related to a problem? Please describe.

Many RTOS platforms (e.g., FreeRTOS, AliOS Things, TencentOS-tiny, LiteOS) are implemented in C language. To integrate Casbin into RTOS environments for execution and invocation by other modules, we need to first compile Casbin-CPP (C version) within the RTOS. The porting process will need to address several challenges:

  1. Compiler compatibility: As RTOS usually runs on embedded devices, a specific compiler and toolchain might be required to compile and link the code. We need to ensure that the Casbin-CPP library is compatible with the compiler and toolchain used by the target RTOS.
  2. Resource constraints: Embedded devices and RTOS often operate under resource-constrained environments, such as limited memory and storage space. Casbin-CPP may require optimizations to reduce resource usage, e.g., adjusting memory allocation strategies, reducing global variable usage, and optimizing data structures.
  3. System library dependencies: Casbin-CPP may rely on some system libraries, such as the C++ standard library and POSIX API. In an RTOS environment, these libraries may not be fully available or provide limited functionality. Alternative solutions or custom implementations for missing features may be necessary.
  4. Thread safety: Casbin-CPP might not have been designed with thread safety in mind for RTOS environments. Modifications to the library may be necessary to ensure its safety in a multi-threaded environment, such as adding locks and using atomic operations.
  5. Filesystem and persistence: Casbin typically loads policies from files and supports persisting policies to files. However, traditional file systems might not be available in RTOS environments. This may require modifications to the policy loading and persistence parts of Casbin-CPP to adapt to the RTOS environment, e.g., storing policy data in memory or using non-filesystem-based persistence methods.

Describe the solution you'd like

We would like to explore and implement the necessary modifications and optimizations to make Casbin-CPP compatible with RTOS environments. This may include addressing the challenges listed above, such as compiler compatibility, resource constraints, system library dependencies, thread safety, and filesystem adaptations.

Describe alternatives you've considered

An alternative solution would be to implement a new library specifically designed for RTOS environments. However, porting the existing Casbin-CPP library would allow for better code reusability and maintainability.

Additional context

This feature request is in response to the growing demand for integrating Casbin into IoT devices and other embedded systems running RTOS. By porting Casbin-CPP to RTOS, we can expand the library's applicability and make it a more versatile solution for access control and authorization in various contexts.

@casbin-bot
Copy link
Member

@casbin-bot casbin-bot added the question Further information is requested label May 5, 2023
@hsluoyz hsluoyz added enhancement New feature or request and removed question Further information is requested labels May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants