misc(project): add missing documentation and cleanup
This commit is contained in:
+1
-1
@@ -41,4 +41,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Complete documentation
|
- Complete documentation
|
||||||
- Build and installation automation (Makefile, install.sh)
|
- 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
|
||||||
|
|||||||
@@ -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.
|
||||||
@@ -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 <marc.villain@epita.fr>"
|
||||||
|
],
|
||||||
|
"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"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -94,6 +94,15 @@ docker-check: docker-install
|
|||||||
@echo "Running tests in Docker..."
|
@echo "Running tests in Docker..."
|
||||||
@./tools/docker_test.sh $(DOCKER_CONTAINER) morbac_test postgres
|
@./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
|
# Show help
|
||||||
.PHONY: help
|
.PHONY: help
|
||||||
help:
|
help:
|
||||||
@@ -106,6 +115,7 @@ help:
|
|||||||
@echo " make install - Build and install $(PROJECT_FILENAME) to PostgreSQL"
|
@echo " make install - Build and install $(PROJECT_FILENAME) to PostgreSQL"
|
||||||
@echo " make uninstall - Uninstall $(PROJECT_FILENAME) from PostgreSQL"
|
@echo " make uninstall - Uninstall $(PROJECT_FILENAME) from PostgreSQL"
|
||||||
@echo " make clean - Clean up generated files"
|
@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 " make help - Show this help"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Docker targets:"
|
@echo "Docker targets:"
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ A PostgreSQL extension implementing the Multi-OrBAC access control model - enabl
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Clone repository
|
# Clone repository
|
||||||
git clone https://github.com/yourusername/pgmorbac.git
|
git clone https://github.com/MarcVillain/pgmorbac.git
|
||||||
cd pgmorbac
|
cd pgmorbac
|
||||||
|
|
||||||
# Build and install extension
|
# 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.
|
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/yourusername/pgmorbac.git
|
git clone https://github.com/MarcVillain/pgmorbac.git
|
||||||
cd pgmorbac
|
cd pgmorbac
|
||||||
|
|
||||||
# Edit source files in src/
|
# Edit source files in src/
|
||||||
@@ -237,8 +237,8 @@ git push --tags
|
|||||||
## Support
|
## Support
|
||||||
|
|
||||||
- Read the [documentation](docs/DOCUMENTATION.md)
|
- Read the [documentation](docs/DOCUMENTATION.md)
|
||||||
- Report bugs via [GitHub Issues](https://github.com/yourusername/pgmorbac/issues)
|
- Report bugs via [GitHub Issues](https://github.com/MarcVillain/pgmorbac/issues)
|
||||||
- Ask questions in [Discussions](https://github.com/yourusername/pgmorbac/discussions)
|
- Ask questions in [Discussions](https://github.com/MarcVillain/pgmorbac/discussions)
|
||||||
- Security issues: see [SECURITY.md](SECURITY.md)
|
- Security issues: see [SECURITY.md](SECURITY.md)
|
||||||
|
|
||||||
## Comparison with Traditional RBAC
|
## Comparison with Traditional RBAC
|
||||||
|
|||||||
@@ -2,6 +2,5 @@
|
|||||||
# Multi-OrBAC access control model for PostgreSQL
|
# Multi-OrBAC access control model for PostgreSQL
|
||||||
comment = 'Multi-OrBAC: Organization-Based Access Control with multi-organization support'
|
comment = 'Multi-OrBAC: Organization-Based Access Control with multi-organization support'
|
||||||
default_version = '1.0.0'
|
default_version = '1.0.0'
|
||||||
module_pathname = '$libdir/pgmorbac'
|
|
||||||
relocatable = false
|
relocatable = false
|
||||||
schema = morbac
|
schema = morbac
|
||||||
|
|||||||
Executable
+68
@@ -0,0 +1,68 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# bump_version.sh - Bump pgmorbac version across all relevant files
|
||||||
|
# Usage: ./tools/bump_version.sh <new_version>
|
||||||
|
# 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 <new_version>"
|
||||||
|
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"
|
||||||
Reference in New Issue
Block a user