Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
778e376
feat(example): add example project to test the engine library
dgarciasquare1 Jul 8, 2025
8e9542b
chore(pubspec): update project description for clarity and add meta d…
dgarciasquare1 Jul 8, 2025
6287ec5
feat(policy): implement core policy management and evaluation interfa…
dgarciasquare1 Jul 8, 2025
85a5ee8
feat(logging): introduce LogHandler for structured logging and config…
dgarciasquare1 Jul 9, 2025
a1c7993
feat(json): implement JsonHandler for robust JSON conversion and vali…
dgarciasquare1 Jul 15, 2025
c6ac2ee
chore(analysis): update analysis options and linter rules for improve…
dgarciasquare1 Jul 15, 2025
4facc99
feat(logging): implement LogHandler for structured logging and enhanc…
dgarciasquare1 Jul 15, 2025
b05031c
refactor(json): streamline JSON parsing and serialization, replacing …
dgarciasquare1 Jul 15, 2025
2ea9d97
refactor(policy): consolidate policy management and evaluation and en…
dgarciasquare1 Jul 15, 2025
1c5d4d5
chore(ios): update .gitignore and AppDelegate for Swift 5.7 compatibi…
dgarciasquare1 Jul 15, 2025
70aa451
feat(policy): integrate PolicyManager into example app and enhance UI…
dgarciasquare1 Jul 15, 2025
2c7f0cf
refactor(policy): enhance PolicyManager by optimizing JSON parsing wi…
dgarciasquare1 Jul 16, 2025
7acd0aa
feat(policy): enhance management by add deep copy functionality and i…
dgarciasquare1 Jul 16, 2025
f97aa07
refactor(logging): enhance LogHandler with detailed documentation and…
dgarciasquare1 Jul 16, 2025
c14be9c
refactor(tests): improve readability and maintainability by restructu…
dgarciasquare1 Jul 16, 2025
4834a66
refactor(tests): enhance type safety and readability in policy test a…
dgarciasquare1 Jul 16, 2025
f1d5e6d
chore(android): update Flutter version to 3.29.3 and add build files …
dgarciasquare1 Jul 16, 2025
a80f46f
fix(android): update fingerprint configuration files
dgarciasquare1 Jul 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fvmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"flutter": "stable"
"flutter": "3.29.3"
}
22 changes: 22 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,25 @@ include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

linter:
rules:
# Documentation
public_member_api_docs: true

# Performance
avoid_print: true
prefer_const_constructors: true
prefer_const_declarations: true

# Style
prefer_final_locals: true
prefer_single_quotes: true

# Safety
avoid_dynamic_calls: true
avoid_type_to_string: true

# Library specific
library_private_types_in_public_api: true
missing_whitespace_between_adjacent_strings: true
45 changes: 45 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
45 changes: 45 additions & 0 deletions example/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
- platform: android
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
- platform: ios
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
- platform: linux
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
- platform: macos
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
- platform: web
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
- platform: windows
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
38 changes: 38 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# flutter_policy_engine_example

A comprehensive example demonstrating how to use the `flutter_policy_engine` library for implementing Attribute-Based Access Control (ABAC) and Role-Based Access Control (RBAC) in Flutter applications.

## Overview

The `flutter_policy_engine` library provides a lightweight, extensible policy engine for Flutter applications. It allows you to define, manage, and evaluate access control rules declaratively using ABAC or RBAC models.

## Features Demonstrated

- **Attribute-Based Access Control (ABAC)**: Define policies based on user attributes, resource properties, and environmental factors
- **Role-Based Access Control (RBAC)**: Implement role-based permissions with hierarchical role structures
- **Declarative Rule Definitions**: Define policies using a clean, readable syntax
- **Extensible Design**: Easily extend the engine with custom evaluators and conditions
- **Flutter Integration**: Seamless integration with Flutter widgets and state management

## Installation

Add the `flutter_policy_engine` dependency to your `pubspec.yaml`:

```yaml
dependencies:
flutter_policy_engine: ^0.0.1
```

Then run:

```bash
flutter pub get
```

## Basic Usage

### 1. Import the Library

```dart
import 'package:flutter_policy_engine/flutter_policy_engine.dart';
```
28 changes: 28 additions & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
13 changes: 13 additions & 0 deletions example/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks
Loading