Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutter": "stable"
}
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 🚀 Release

on:
push:
branches:
- main # The branch you want to release from

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: ⬇️ Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: ⬢ Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: 📦 Install dependencies
run: npm ci

- name: 🚀 Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Comes from GitHub
run: npx semantic-release
28 changes: 28 additions & 0 deletions .github/workflows/validate-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 🛡️ Validate Commit Messages

on:
push:
pull_request:

jobs:
check-commits:
runs-on: ubuntu-latest

steps:
- name: ⬇️ Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: ⬢ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: 📦 Install Commitlint
run: |
npm install --save-dev @commitlint/{config-conventional,cli}

- name: 🔍 Validate commit messages (entire branch)
run: |
npx commitlint --from=$(git rev-list --max-parents=0 HEAD) --to=HEAD --verbose
21 changes: 18 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
.buildlog/
.history



# Flutter repo-specific
/bin/cache/
/bin/internal/bootstrap.bat
Expand Down Expand Up @@ -116,4 +114,21 @@ app.*.symbols
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
!/dev/ci/**/Gemfile.lock
!/dev/ci/**/Gemfile.lock

# Node.js
node_modules/

# Husky
.husky/_/

# IDEs
.idea/
.vscode/
*.iml

# Archivos de sistema
.DS_Store

# FVM Version Cache
.fvm/
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm test
10 changes: 10 additions & 0 deletions .metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 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: package
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.0.1

* TODO: Describe initial release.
49 changes: 48 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,49 @@
# flutter_policy_engine
flutter_policy_engine is a lightweight and extensible policy engine for Flutter that lets you define, manage, and evaluate access control rules declaratively using ABAC (Attribute-Based Access Control) or RBAC models.

A lightweight, extensible policy engine for Flutter. Define, manage, and evaluate access control rules declaratively using ABAC (Attribute-Based Access Control) or RBAC (Role-Based Access Control) models.

## Features

- Attribute-Based and Role-Based Access Control (ABAC/RBAC)
- Declarative rule definitions
- Extensible and modular design
- Easy integration with Flutter apps

## Installation

Ensure you have [Flutter](https://docs.flutter.dev/get-started/install) and [Dart](https://dart.dev/get-dart) installed. [FVM](https://fvm.app/) is recommended for managing Flutter versions.

```bash
# Clone the repository and enter the directory
git clone <repo-url>
cd flutter_policy_engine

# Run the setup script (requires bash, Flutter, Node.js, and npm)
./setup.sh
```

The setup script will:

- Check for Flutter and FVM
- Install the Flutter version from `.fvm/fvm_config.json` (if present)
- Install Dart/Flutter dependencies (`pub get`)
- Install Node.js dependencies (if `package.json` exists)
- Initialize Husky for git hooks (if present)
- Add `.fvm/` to `.gitignore` if needed

## Contributing

Contributions are welcome! Please:

- Follow the existing code style and patterns
- Write clear commit messages (Commitlint and Husky are enabled)
- Add or update tests for new features or bug fixes
- Open a pull request with a clear description

## License

MIT © 2025 David Alejandro Garcia Ruiz

---

> **Tip:** If you use VSCode, restart your terminal after setup to ensure FVM is properly detected.
4 changes: 4 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
41 changes: 41 additions & 0 deletions commit-template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Write your commit message using the Conventional Commits format.
#
# Format:
# <type>(<scope>)!: <short summary>
#
# Common types:
# feat: a new feature
# fix: a bug fix
# docs: documentation only changes
# style: changes that do not affect code meaning (formatting, etc.)
# refactor: code change that neither fixes a bug nor adds a feature
# test: adding or updating tests
# chore: other changes that don't modify src or test files
#
# Use "!" after the type or scope to indicate a BREAKING CHANGE.
#
# Examples:
# feat!: drop support for Node 12
# refactor(auth)!: change token structure
# fix(ui): correct layout on iOS
# docs(readme): add usage instructions
#
# Optional body:
# - Explain the motivation for the change
# - Highlight what changed
#
# BREAKING CHANGE (in body, if needed):
# Add a line that starts with "BREAKING CHANGE:" followed by the explanation.
#
# Example with body and breaking change:
#
# feat(auth)!: switch to OAuth 2.1
#
# This update replaces the old token system with OAuth 2.1 for better security.
#
# BREAKING CHANGE: Old refresh tokens will no longer work.
#
# Guidelines:
# - Keep the subject line under 72 characters.
# - Use the imperative mood: "add", not "added" or "adds".
# - Leave a blank line between subject, body, and footer (if any).
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
};
7 changes: 7 additions & 0 deletions lib/flutter_policy_engine.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
library flutter_policy_engine;

/// A Calculator.
class Calculator {
/// Returns [value] plus 1.
int addOne(int value) => value + 1;
}
Loading