php-casbin / laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.
Apache License 2.0
280 stars 47 forks source link

feat: loading model from remote url #69

Closed rev3z closed 3 months ago

rev3z commented 3 months ago

Description

This PR introduces an enhancement to enhance the flexibility of the Enforcer's model management:

  1. Remote Model Initialization via URL: This feature enables the Enforcer to fetch its model configuration from a remote URL at startup.

  2. Refactoring with Factory Pattern for Model Loading: To streamline and abstract the complexity of model loading processes, a new ModelLoaderFactory class has been introduced.

Upon initialization, the system not only supports fetching plain text model configurations from URLs but also sets the stage for more sophisticated content handling through custom implementations of \Lauthz\Loaders\ModelLoader, catering to diverse content types like JSON.

Related Issues

[Question] Loading model from a remote URL #15

Details

hsluoyz commented 3 months ago

@leeqvip plz review

rev3z commented 3 months ago

Unit tests added.

leeqvip commented 3 months ago

@rev3z Please fix the ci check error.

rev3z commented 3 months ago

I'll fix it!

rev3z commented 3 months ago

CI error fixed, PR contents updated.

hsluoyz commented 3 months ago

@leeqvip plz review

leeqvip commented 3 months ago

:tada: This PR is included in version 3.3.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: