diff --git a/CHANGELOG.md b/CHANGELOG.md index caaec7f..5040486 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,4 +41,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Complete documentation - Build and installation automation (Makefile, install.sh) -[1.0.0]: https://github.com/yourusername/pgmorbac/releases/tag/v1.0.0 +[1.0.0]: https://github.com/MarcVillain/pgmorbac/releases/tag/v1.0.0 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..0882451 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,32 @@ +# Code of Conduct + +## Summary + +This is a technical project. Participation is open to anyone willing to contribute constructively and treat others with basic professional respect. + +## Expected Behavior + +- Be respectful and professional in all interactions +- Critique ideas, not people — disagreement is fine, personal attacks are not +- Give and receive feedback constructively +- Keep discussions focused on the work +- Accept that maintainers have final say on project decisions + +## Unacceptable Behavior + +- Personal insults, name-calling, or targeted hostility +- Deliberate intimidation or persistent unwanted contact +- Sharing someone's private information without their consent +- Sustained disruption of discussions or contributions + +## Scope + +This Code of Conduct applies to all project spaces: issues, pull requests, discussions, and any other venue where people interact around this project. + +## Enforcement + +If you witness or experience behavior that violates this Code of Conduct, report it by opening an issue or contacting the maintainer directly. Reports will be reviewed and handled at the maintainer's discretion. Consequences may include warnings, removal of contributions, or a ban from the project. + +## In Short + +Act like a professional. Help build something useful. That's it. diff --git a/META.json b/META.json new file mode 100644 index 0000000..9087f59 --- /dev/null +++ b/META.json @@ -0,0 +1,48 @@ +{ + "name": "pgmorbac", + "abstract": "Multi-OrBAC: Organization-Based Access Control with multi-organization support", + "description": "A PostgreSQL extension implementing the Multi-OrBAC access control model — enabling organization-centric, context-aware, and hierarchical access control with delegation, separation of duty, and cross-organizational policies.", + "version": "1.0.0", + "maintainer": [ + "Marc VILLAIN " + ], + "license": "mit", + "provides": { + "pgmorbac": { + "abstract": "Multi-OrBAC access control extension", + "file": "pgmorbac--1.0.0.sql", + "version": "1.0.0" + } + }, + "prereqs": { + "runtime": { + "requires": { + "PostgreSQL": "13.0.0" + } + } + }, + "resources": { + "homepage": "https://github.com/MarcVillain/pgmorbac", + "bugtracker": { + "web": "https://github.com/MarcVillain/pgmorbac/issues" + }, + "repository": { + "url": "https://github.com/MarcVillain/pgmorbac.git", + "type": "git" + } + }, + "generated_by": "pgmorbac contributors", + "meta-spec": { + "version": "1.0.0", + "url": "https://pgxn.org/spec/" + }, + "tags": [ + "access control", + "authorization", + "multi-tenancy", + "rbac", + "orbac", + "security", + "row-level security" + ] +} diff --git a/Makefile b/Makefile index 539158b..7112f3e 100644 --- a/Makefile +++ b/Makefile @@ -94,6 +94,15 @@ docker-check: docker-install @echo "Running tests in Docker..." @./tools/docker_test.sh $(DOCKER_CONTAINER) morbac_test postgres +# Bump version across all relevant files +.PHONY: bump-version +bump-version: + @if [ -z "$(VERSION)" ]; then \ + echo "Usage: make bump-version VERSION=X.Y.Z"; \ + exit 1; \ + fi + @./tools/bump_version.sh $(VERSION) + # Show help .PHONY: help help: @@ -106,6 +115,7 @@ help: @echo " make install - Build and install $(PROJECT_FILENAME) to PostgreSQL" @echo " make uninstall - Uninstall $(PROJECT_FILENAME) from PostgreSQL" @echo " make clean - Clean up generated files" + @echo " make bump-version - Bump version in all files (e.g. make bump-version VERSION=1.1.0)" @echo " make help - Show this help" @echo "" @echo "Docker targets:" diff --git a/README.md b/README.md index 9092636..d987469 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ A PostgreSQL extension implementing the Multi-OrBAC access control model - enabl ```bash # Clone repository -git clone https://github.com/yourusername/pgmorbac.git +git clone https://github.com/MarcVillain/pgmorbac.git cd pgmorbac # Build and install extension @@ -216,7 +216,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. ```bash -git clone https://github.com/yourusername/pgmorbac.git +git clone https://github.com/MarcVillain/pgmorbac.git cd pgmorbac # Edit source files in src/ @@ -237,8 +237,8 @@ git push --tags ## Support - Read the [documentation](docs/DOCUMENTATION.md) -- Report bugs via [GitHub Issues](https://github.com/yourusername/pgmorbac/issues) -- Ask questions in [Discussions](https://github.com/yourusername/pgmorbac/discussions) +- Report bugs via [GitHub Issues](https://github.com/MarcVillain/pgmorbac/issues) +- Ask questions in [Discussions](https://github.com/MarcVillain/pgmorbac/discussions) - Security issues: see [SECURITY.md](SECURITY.md) ## Comparison with Traditional RBAC diff --git a/pgmorbac.control b/pgmorbac.control index 2cf2853..0f32249 100644 --- a/pgmorbac.control +++ b/pgmorbac.control @@ -2,6 +2,5 @@ # Multi-OrBAC access control model for PostgreSQL comment = 'Multi-OrBAC: Organization-Based Access Control with multi-organization support' default_version = '1.0.0' -module_pathname = '$libdir/pgmorbac' relocatable = false schema = morbac diff --git a/tools/bump_version.sh b/tools/bump_version.sh new file mode 100755 index 0000000..9990667 --- /dev/null +++ b/tools/bump_version.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +# bump_version.sh - Bump pgmorbac version across all relevant files +# Usage: ./tools/bump_version.sh +# Example: ./tools/bump_version.sh 1.1.0 + +set -e + +NEW_VERSION="${1:-}" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +CONTROL_FILE="$ROOT_DIR/pgmorbac.control" +META_FILE="$ROOT_DIR/META.json" +README_FILE="$ROOT_DIR/README.md" + +# --- Validate input --- +if [ -z "$NEW_VERSION" ]; then + echo "Usage: $0 " + echo "Example: $0 1.1.0" + exit 1 +fi + +if ! echo "$NEW_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then + echo "Error: version must follow semver format X.Y.Z (e.g. 1.1.0)" + exit 1 +fi + +# --- Get current version --- +OLD_VERSION=$(./tools/get_version.sh "$CONTROL_FILE") + +if [ "$OLD_VERSION" = "$NEW_VERSION" ]; then + echo "Already at version $NEW_VERSION, nothing to do." + exit 0 +fi + +echo "Bumping version: $OLD_VERSION → $NEW_VERSION" + +# --- pgmorbac.control --- +sed -i.bak "s/default_version = '$OLD_VERSION'/default_version = '$NEW_VERSION'/" "$CONTROL_FILE" +echo " Updated $CONTROL_FILE" + +# --- META.json --- +sed -i.bak \ + -e "s/\"version\": \"$OLD_VERSION\"/\"version\": \"$NEW_VERSION\"/g" \ + -e "s/pgmorbac--$OLD_VERSION\.sql/pgmorbac--$NEW_VERSION.sql/g" \ + "$META_FILE" +echo " Updated $META_FILE" + +# --- README.md (hardcoded version references in manual install section) --- +sed -i.bak \ + -e "s/pgmorbac--$OLD_VERSION\.sql/pgmorbac--$NEW_VERSION.sql/g" \ + "$README_FILE" +echo " Updated $README_FILE" + +# --- Clean up .bak files --- +find "$ROOT_DIR" -maxdepth 1 -name "*.bak" -delete +find "$ROOT_DIR/tools" -maxdepth 1 -name "*.bak" -delete + +echo "" +echo "Done. Version is now $NEW_VERSION." +echo "" +echo "Next steps:" +echo " 1. Add a [$NEW_VERSION] section to CHANGELOG.md" +echo " 2. Run: make build" +echo " 3. Run: make test" +echo " 4. Commit: git commit -am \"chore: bump version to $NEW_VERSION\"" +echo " 5. Tag: git tag -a v$NEW_VERSION -m \"Release $NEW_VERSION\"" +echo " 6. Push: git push && git push --tags"