From 51c23a4f0b17c00bb348ad4db5d4c2f47f289612 Mon Sep 17 00:00:00 2001 From: Alexis Saettler Date: Tue, 11 Jan 2022 20:35:44 +0100 Subject: [PATCH] docs: update readme (#353) --- .gitattributes | 2 + LICENSE => LICENSE.md | 2 +- README.md | 14 +-- scripts/tests/runsonar.sh | 176 -------------------------------------- 4 files changed, 10 insertions(+), 184 deletions(-) rename LICENSE => LICENSE.md (96%) delete mode 100755 scripts/tests/runsonar.sh diff --git a/.gitattributes b/.gitattributes index 01f3a764..b6a1fcb8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,8 +3,10 @@ .editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore +.releaserc export-ignore .styleci.yml export-ignore CHANGELOG.md export-ignore +crowdin.yml export-ignore phpstan.neon export-ignore phpunit.xml export-ignore psalm.xml export-ignore diff --git a/LICENSE b/LICENSE.md similarity index 96% rename from LICENSE rename to LICENSE.md index 406633e0..e2758761 100644 --- a/LICENSE +++ b/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 Alexis Saettler +Copyright © 2019–2022 Alexis Saettler Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index d43f49af..88cc47cb 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,11 @@ Webauthn adapter for Laravel LaravelWebauthn is an adapter to use Webauthn as 2FA (second-factor authentication) on Laravel. -[![Latest Version](https://img.shields.io/packagist/v/asbiin/laravel-webauthn.svg?style=flat-square)](https://github.com/asbiin/laravel-webauthn/releases) -[![Downloads](https://img.shields.io/packagist/dt/asbiin/laravel-webauthn.svg?style=flat-square)](https://packagist.org/packages/asbiin/laravel-webauthn) -[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/asbiin/laravel-webauthn/Laravel%20WebAuthn%20workflow?style=flat-square)](https://github.com/asbiin/laravel-webauthn/actions?query=branch%3Amaster) -[![Sonar Quality Gate](https://img.shields.io/sonar/quality_gate/asbiin_laravel-webauthn?server=https%3A%2F%2Fsonarcloud.io&style=flat-square)](https://sonarcloud.io/dashboard?id=asbiin_laravel-webauthn) -[![Coverage Status](https://img.shields.io/sonar/https/sonarcloud.io/asbiin_laravel-webauthn/coverage.svg?style=flat-square)](https://sonarcloud.io/dashboard?id=asbiin_laravel-webauthn) +[![Latest Version](https://img.shields.io/packagist/v/asbiin/laravel-webauthn.svg?style=flat-square&label=Latest%20Version)](https://github.com/asbiin/laravel-webauthn/releases) +[![Downloads](https://img.shields.io/packagist/dt/asbiin/laravel-webauthn.svg?style=flat-square&label=Downloads)](https://packagist.org/packages/asbiin/laravel-webauthn) +[![Workflow Status](https://img.shields.io/github/workflow/status/asbiin/laravel-webauthn/Laravel%20WebAuthn%20workflow?style=flat-square&label=Workflow%20Status)](https://github.com/asbiin/laravel-webauthn/actions?query=branch%3Amain) +[![Quality Gate](https://img.shields.io/sonar/quality_gate/asbiin_laravel-webauthn?server=https%3A%2F%2Fsonarcloud.io&style=flat-square&label=Quality%20Gate)](https://sonarcloud.io/dashboard?id=asbiin_laravel-webauthn) +[![Coverage Status](https://img.shields.io/sonar/coverage/asbiin_laravel-webauthn?server=https%3A%2F%2Fsonarcloud.io&style=flat-square&label=Coverage%20Status)](https://sonarcloud.io/dashboard?id=asbiin_laravel-webauthn) # Installation @@ -219,6 +219,6 @@ Events are dispatched by LaravelWebauthn: Author: [Alexis Saettler](https://github.com/asbiin) -Copyright © 2019-2020. +Copyright © 2019–2022. -Licensed under the MIT License. [View license](/LICENSE). +Licensed under the MIT License. [View license](/LICENSE.md). diff --git a/scripts/tests/runsonar.sh b/scripts/tests/runsonar.sh deleted file mode 100755 index 5db7aadf..00000000 --- a/scripts/tests/runsonar.sh +++ /dev/null @@ -1,176 +0,0 @@ -#!/bin/bash - -RUNREVPARSE=false -REPO=$GITHUB_REPOSITORY -BRANCH=${GITHUB_HEAD_REF:-GITHUB_REF} -BRANCH=${BRANCH##refs/heads/} -#PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") -BUILD_NUMBER=$RUNNER_TRACKING_ID -GIT_COMMIT=$GITHUB_SHA - -echo "REPO=$REPO" -echo "BRANCH=$BRANCH" -#echo "PR_NUMBER=$PR_NUMBER" -echo "BUILD_NUMBER=$BUILD_NUMBER" -echo "GIT_COMMIT=$GIT_COMMIT" - -set -euo pipefail - -REPOSITORY_OWNER=asbiin/laravel-webauthn -SONAR_ORGANIZATION=asbiin-github - -function installSonar { - echo '== Setup sonar scanner' - - # set version of sonar scanner to use : - sonarversion=${SONAR_VERSION:-} - if [ -z "${sonarversion:-}" ]; then - sonarversion=3.2.0.1227 - fi - echo "== Using sonarscanner $sonarversion" - - mkdir -p $HOME/sonarscanner - pushd $HOME/sonarscanner > /dev/null - if [ ! -d "sonar-scanner-$sonarversion" ]; then - echo "== Downloading sonarscanner $sonarversion" - java_path=$(which java || true) - if [ -x "$java_path" ]; then - wget --quiet --continue https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$sonarversion.zip - unzip -q sonar-scanner-cli-$sonarversion.zip - rm sonar-scanner-cli-$sonarversion.zip - else - wget --quiet --continue https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$sonarversion-linux.zip - unzip -q sonar-scanner-cli-$sonarversion-linux.zip - rm sonar-scanner-cli-$sonarversion-linux.zip - mv sonar-scanner-$sonarversion-linux sonar-scanner-$sonarversion - fi - fi - export SONAR_SCANNER_HOME=$HOME/sonarscanner/sonar-scanner-$sonarversion - export PATH=$SONAR_SCANNER_HOME/bin:$PATH - popd > /dev/null -} - -function CommonParams { - extra="" - if [ "$REPO" != "$REPOSITORY_OWNER" ]; then - # Avoid forks to send reports to the same project - project="${REPO/\//_}" - extra="$extra -Dsonar.projectKey=asbiin_laravel-webauthn:$project -Dsonar.projectName=$project" - fi - - echo -Dsonar.host.url=$SONAR_HOST_URL \ - -Dsonar.organization=$SONAR_ORGANIZATION \ - -Dsonar.php.tests.reportPath=$SONAR_RESULT \ - -Dsonar.php.coverage.reportPaths=$SONAR_COVERAGE \ - -Dsonar.analysis.buildNumber=$BUILD_NUMBER \ - -Dsonar.analysis.pipeline=$BUILD_NUMBER \ - -Dsonar.analysis.sha1=$GIT_COMMIT \ - -Dsonar.analysis.repository=$REPO \ - $extra -} - -function gitFetch { - echo '== gitFetch' - echo '# git fetch --all' - git fetch --all - if [ "$RUNREVPARSE" == "true" ]; then - if [ -n "${PULL_REQUEST_BASEBRANCH:-}" ]; then - echo "# git branch -D $PULL_REQUEST_BASEBRANCH" - git branch -D $PULL_REQUEST_BASEBRANCH - echo "# git rev-parse origin/$PULL_REQUEST_BASEBRANCH" - git rev-parse origin/$PULL_REQUEST_BASEBRANCH - fi - fi - echo '' -} - -if [ -z "${SONAR_HOST_URL:-}" ]; then - export SONAR_HOST_URL=https://sonarcloud.io -fi - -if [ "$BRANCH" == "master" ] && [ "$PR_NUMBER" == "false" ] && [ -n "${SONAR_TOKEN:-}" ]; then - echo '==========================' - echo '== SONAR:Analyze master ==' - echo '==========================' - installSonar - gitFetch - - SONAR_PARAMS="$(CommonParams) \ - -Dsonar.projectVersion=master" - - echo "# sonar-scanner $SONAR_PARAMS" - $SONAR_SCANNER_HOME/bin/sonar-scanner $SONAR_PARAMS -Dsonar.login=$SONAR_TOKEN - exit $? - -elif [ -n "${BRANCH:-}" ] && [ "$PR_NUMBER" == "false" ] && [ -n "${SONAR_TOKEN:-}" ]; then - echo '==================================' - echo '== SONAR:Analyze release branch ==' - echo '==================================' - installSonar - gitFetch - - SONAR_PARAMS="$(CommonParams) \ - -Dsonar.projectVersion=$(git describe --abbrev=0 --tags --exact-match ${GIT_COMMIT} 2>/dev/null >/dev/null)" - - echo "# sonar-scanner $SONAR_PARAMS" - $SONAR_SCANNER_HOME/bin/sonar-scanner $SONAR_PARAMS -Dsonar.login=$SONAR_TOKEN - exit $? - -elif [ "$PR_NUMBER" != "false" ] && [ -n "${SONAR_TOKEN:-}" ] && [ -n "${GITHUB_TOKEN:-}" ]; then - - REPOS_VALUES=($(curl -H "Authorization: token $GITHUB_TOKEN" -sSL https://api.github.com/repos/$REPO/pulls/$PR_NUMBER | jq -r -c ".head.repo.full_name, .head.repo.owner.login, .base.ref, .head.ref")) - - PULL_REQUEST_BRANCH= - PULL_REQUEST_REPOSITORY=$(jq --raw-output .repository.full_name "$GITHUB_EVENT_PATH") - PULL_REQUEST_USER=$(jq --raw-output .repository.owner.login "$GITHUB_EVENT_PATH") - PULL_REQUEST_BASEBRANCH=$(jq --raw-output .base_ref "$GITHUB_EVENT_PATH") - PULL_REQUEST_HEADBRANCH=$(jq --raw-output .ref "$GITHUB_EVENT_PATH") - -fork=$(jq --raw-output .repository.fork "$GITHUB_EVENT_PATH") - - - if [ -z "${PULL_REQUEST_REPOSITORY:-}" ] || [ "$PULL_REQUEST_REPOSITORY" == "null" ]; then - echo '== Error with github api call' - exit 11 - elif [ "$PULL_REQUEST_REPOSITORY" == "$REPOSITORY_OWNER" ]; then - echo '=========================================' - echo '== SONAR:Analyze internal pull request ==' - echo '=========================================' - PULL_REQUEST_BRANCH=$PULL_REQUEST_HEADBRANCH - else - echo '=========================================' - echo '== SONAR:Analyze external pull request ==' - echo '=========================================' - echo "== External repository: $PULL_REQUEST_REPOSITORY" - PULL_REQUEST_BRANCH="${PULL_REQUEST_USER}__$PULL_REQUEST_HEADBRANCH" - -PULL_REQUEST_BASEBRANCH=$GITHUB_BASE_REF -PULL_REQUEST_HEADBRANCH=$GITHUB_HEAD_REF - - fi - echo "PULL_REQUEST_BRANCH=$PULL_REQUEST_BRANCH" - echo "PULL_REQUEST_REPOSITORY=$PULL_REQUEST_REPOSITORY" - echo "PULL_REQUEST_USER=$PULL_REQUEST_USER" - echo "PULL_REQUEST_BASEBRANCH=$PULL_REQUEST_BASEBRANCH" - echo "PULL_REQUEST_HEADBRANCH=$PULL_REQUEST_HEADBRANCH" - - installSonar - gitFetch - - SONAR_PARAMS="$(CommonParams) \ - -Dsonar.pullrequest.key=$PR_NUMBER \ - -Dsonar.pullrequest.base=$PULL_REQUEST_BASEBRANCH \ - -Dsonar.pullrequest.branch=$PULL_REQUEST_BRANCH \ - -Dsonar.pullrequest.provider=GitHub \ - -Dsonar.pullrequest.github.repository=$REPO" - - echo "# sonar-scanner $SONAR_PARAMS" - $SONAR_SCANNER_HOME/bin/sonar-scanner $SONAR_PARAMS -Dsonar.login=$SONAR_TOKEN - exit $? - -else - echo '======================' - echo '== SONAR:No analyze ==' - echo '======================' - -fi