Skip to content

Commit 41fa86c

Browse files
authored
Merge pull request #14 from poprazvan17/3.0
Documentation v3 dot-authorization
2 parents 95640f3 + bfc7379 commit 41fa86c

File tree

14 files changed

+154
-102
lines changed

14 files changed

+154
-102
lines changed
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
on:
22
- push
33

4-
name: Run PHPUnit tests
4+
name: Run Codecov checks
55

66
jobs:
7-
mutation:
8-
name: PHP ${{ matrix.php }}-${{ matrix.os }}
7+
code-coverage:
8+
name: Code Coverage
99

1010
runs-on: ${{ matrix.os }}
1111

@@ -27,8 +27,9 @@ jobs:
2727
uses: shivammathur/setup-php@v2
2828
with:
2929
php-version: "${{ matrix.php }}"
30+
coverage: pcov
31+
ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
3032
tools: composer:v2, cs2pr
31-
coverage: none
3233

3334
- name: Determine composer cache directory
3435
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
@@ -44,5 +45,10 @@ jobs:
4445
- name: Install dependencies with composer
4546
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
4647

47-
- name: Run PHPUnit tests
48-
run: vendor/bin/phpunit --colors=always
48+
- name: Collect code coverage with PHPUnit
49+
run: vendor/bin/phpunit --colors=always --coverage-clover clover.xml
50+
51+
- name: Send code coverage report to Codecov.io
52+
uses: codecov/codecov-action@v3
53+
with:
54+
token: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: "Continuous Integration"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
tags:
8+
9+
jobs:
10+
ci:
11+
uses: laminas/workflow-continuous-integration/.github/workflows/continuous-integration.yml@1.x

.github/workflows/cs-tests.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/docs-build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: docs-build
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Build Docs
13+
uses: dotkernel/documentation-theme/github-actions/docs@main
14+
env:
15+
DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/static-analysis.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ Authorization base package defining interfaces for authorization services to be
1010
[![GitHub stars](https://img.shields.io/github/stars/dotkernel/dot-authorization)](https://github.com/dotkernel/dot-authorization/stargazers)
1111
[![GitHub license](https://img.shields.io/github/license/dotkernel/dot-authorization)](https://github.com/dotkernel/dot-authorization/blob/3.0/LICENSE.md)
1212

13-
[![Build Static](https://github.com/dotkernel/dot-authorization/actions/workflows/static-analysis.yml/badge.svg?branch=3.0)](https://github.com/dotkernel/dot-authorization/actions/workflows/static-analysis.yml)
13+
[![Build Static](https://github.com/dotkernel/dot-authorization/actions/workflows/continuous-integration.yml/badge.svg?branch=3.0)](https://github.com/dotkernel/dot-authorization/actions/workflows/continuous-integration.yml)
14+
[![codecov](https://codecov.io/gh/dotkernel/dot-authorization/graph/badge.svg?token=ZBZDEA3LY8)](https://codecov.io/gh/dotkernel/dot-authorization)
1415

1516
[![SymfonyInsight](https://insight.symfony.com/projects/014df510-1cf7-4876-b1a8-303fbef2f364/big.svg)](https://insight.symfony.com/projects/014df510-1cf7-4876-b1a8-303fbef2f364)
1617

17-
1818
## Installation
1919

2020
Run the following command in you project directory
21+
2122
```bash
2223
$ composer require dotkernel/dot-authorization
2324
```
@@ -29,14 +30,17 @@ Please note that usually this pacakge will be installed as a dependency to a con
2930
Defines the interface that should be implemented by any authorization service, in order to work with DotKernel applications. This is a result of the fact that, by default, any DotKernel package which has to do with authorization is assuming that a service is registered in the service container using as service name this interface's FQN
3031

3132
### Methods
33+
3234
```php
3335
public function isGranted(string $permission, array $roles = [], $context = null): bool;
3436
```
37+
3538
* this is the only method that deals with authorization. Given a permission and a list of roles, should return a boolean value of true if at least one role has access to the requested permission. As you can see, we expect that the authorization service to be implemented as an RBAC.
3639

3740
## RoleInterface
3841

3942
Defines the interface that Role objects must implement. A role object should be able to retrieve its name, so this interface has only one method defined
43+
4044
```php
4145
public function getName(): string;
4246
```

SECURITY.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
6+
| Version | Supported | PHP Version |
7+
|---------|--------------------|-------------------------------------------------------------------------------------------------------------------|
8+
| 3.x | :white_check_mark: | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-authorization/3.4.1) |
9+
| <= 2.x | :x: | |
10+
11+
## Reporting Potential Security Issues
12+
13+
If you have encountered a potential security vulnerability in this project,
14+
please report it to us at <security@dotkernel.com>. We will work with you to
15+
verify the vulnerability and patch it.
16+
17+
When reporting issues, please provide the following information:
18+
19+
- Component(s) affected
20+
- A description indicating how to reproduce the issue
21+
- A summary of the security vulnerability and impact
22+
23+
We request that you contact us via the email address above and give the
24+
project contributors a chance to resolve the vulnerability and issue a new
25+
release prior to any public exposure; this helps protect the project's
26+
users, and provides them with a chance to upgrade and/or update in order to
27+
protect their applications.
28+
29+
30+
## Policy
31+
32+
If we verify a reported security vulnerability, our policy is:
33+
34+
- We will patch the current release branch, as well as the immediate prior minor
35+
release branch.
36+
37+
- After patching the release branches, we will immediately issue new security
38+
fix releases for each patched release branch.
39+

docs/book/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../README.md

docs/book/v3/configuration.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Configuration
2+
3+
Please note that usually this pacakge will be installed as a dependency to a concrete implementation, so you won't need to add this to your project manually.

docs/book/v3/instalation.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Installation
2+
3+
Install `dot-authorization` by executing the following Composer command:
4+
5+
composer require dotkernel/dot-authorization

0 commit comments

Comments
 (0)