Skip to content

Commit

Permalink
Merge branch 'master' into check-server
Browse files Browse the repository at this point in the history
  • Loading branch information
mmattel authored Oct 12, 2021
2 parents 4509594 + d0c4194 commit 50fa756
Show file tree
Hide file tree
Showing 61 changed files with 2,648 additions and 1,867 deletions.
3,489 changes: 1,943 additions & 1,546 deletions .drone.star

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions .drone/cancelBuilds.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
SCRIPT_PATH=$(dirname "$0")
SCRIPT_PATH=$( cd "${SCRIPT_PATH}" && pwd ) # normalized and made absolute

if [ -z "${OWNCLOUD_APP}" ]
then
echo "OWNCLOUD_APP environment variable is required to be defined as the organisation and repo name in the format: owncloud/app_name"
exit 1
fi
# The recentBuilds.txt file contains all the information of the PR whose builds are recently running.
# Therefore, to filter out the BuildID and the Reference from all the recent builds which are running,
# the following awk command is used and the output containing the BuildId and the Reference of each
# builds/prs are stored in the filteredDescriptions.txt file.
awk "/Build #|Ref: refs\/pull/" ${SCRIPT_PATH}/../recentBuilds.txt > ${SCRIPT_PATH}/filteredDescriptions.txt

# The thisBuildInfo.txt file contains the information of the current Build, including the BuildID, Reference, and
# other information of that particular build. To get the reference number/ pr number of the recent build,
# the following awk command and grep commands are used, where the Reference part ("Ref: refs/pull/5496/head")
# is stored in the "thisBuildFiltered.txt" file. From the reference, only the pr/reference number is extracted into
# the "NUMBER" variable.
awk "/Ref: refs\/pull/" ${SCRIPT_PATH}/../thisBuildInfo.txt > ${SCRIPT_PATH}/thisBuildFiltered.txt
NUMBER=$(grep -o -E "[0-9]+" ${SCRIPT_PATH}/thisBuildFiltered.txt)
referenceNum="Ref: refs/pull/"$NUMBER"/head"

# From all the recent builds, the information about the BuildID and the reference which was stored in the
# "filteredDescriptions.txt" file, only the BuildID part from each of the buildInformation whose Reference is
# exactly same as that of the current build reference is filtered and stored in the "buildsToStop.txt" file.
# The buildIDs and the reference information of each build is stored sequentially in the "filteredDescriptions.txt" file as:

# "Build #<buildID-1>"
# "<ReferenceInformationOfBuildID-1>"
# "Build #<buildID-2>"
# "<ReferenceInformationOfBuildID-2>"
# "Build #<buildID-n>"
# "<ReferenceInformationOfBuildID-n>"

# Therefore the following awk command extracts each lines just above the expected reference information.
awk -v ref="$referenceNum" 'index($0,ref){print p} {p=$0}' ${SCRIPT_PATH}/filteredDescriptions.txt > ${SCRIPT_PATH}/buildsToStop.txt


# The "buildsToStop.txt" file now contains the buildIDs of the recent builds whose reference id was equal to the reference of the
# current pr/build.

# "Build #<BuildID-1>"
# "Build #<BuildID-2>"
# "Build #<BuildID-3>"
# "Build #<BuildID-4>"
# "Build #<BuildID-m>"

# For each build in the "buildsToStop.txt" file, if the build number is older than the current drone build number, the build is cancelled.

while IFS="" read -r p || [ -n "$p" ]
do
printf '%s\n' "$p"
buildNumber=$(echo "$p" | awk -F'#' '{print $(2)}')

if [ $DRONE_BUILD_NUMBER \> "$buildNumber" ]
then
echo "CANCELLING BUILD: " $buildNumber
drone build stop $OWNCLOUD_APP $buildNumber
fi

done <${SCRIPT_PATH}/buildsToStop.txt
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/build/
/l10n/.transifexrc
.php_cs.cache
.php-cs-fixer.cache

# Composer
vendor/
Expand Down
2 changes: 1 addition & 1 deletion .phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
*/
return [
// Supported values: '7.0', '7.1', '7.2', null.
// Supported values: '7.2', '7.3', '7.4', '8.0', null.
// If this is set to null,
// then Phan assumes the PHP version which is closest to the minor version
// of the php executable used to execute phan.
Expand Down
File renamed without changes.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## Unreleased - XXXX-XX-XX
## [Unreleased] - XXXX-XX-XX

## [0.5.0] - 2020-08-16

### Added

- Add support for trusted clients [#298](https://github.com/owncloud/oauth2/issues/298)
- Support setups with user login name != internal UID [#286](https://github.com/owncloud/oauth2/issues/286)
- Implement the oauth2 pkce extension [#276](https://github.com/owncloud/oauth2/issues/276)

### Changed

- Return proper error description for auth-core/refresh-token errors [#279](https://github.com/owncloud/oauth2/issues/279)
- Adjust PHP dependencies for composer 2.0 [#273](https://github.com/owncloud/oauth2/issues/273)

## [0.4.4] - 2020-03-03

Expand Down Expand Up @@ -100,6 +112,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Verify Bearer token even if the session is still valid - [#53](https://github.com/owncloud/oauth2/pull/53)
- Use displayname on switch user screen - [#90](https://github.com/owncloud/oauth2/pull/90)

[Unreleased]: https://github.com/owncloud/oauth2/compare/v0.5.0...master
[0.5.0]: https://github.com/owncloud/oauth2/compare/v0.4.4...v0.5.0
[0.4.4]: https://github.com/owncloud/oauth2/compare/v0.4.3...v0.4.4
[0.4.3]: https://github.com/owncloud/oauth2/compare/v0.4.2...v0.4.3
[0.4.2]: https://github.com/owncloud/oauth2/compare/v0.4.1...v0.4.2
Expand Down
14 changes: 2 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
SHELL := /bin/bash

COMPOSER_BIN := $(shell command -v composer 2> /dev/null)
ifndef COMPOSER_BIN
$(error composer is not available on your system, please install composer)
endif

#
# Define NPM and check if it is available on the system.
#
NPM := $(shell command -v npm 2> /dev/null)
ifndef NPM
$(error npm is not available on your system, please install npm)
endif

NODE_PREFIX=$(shell pwd)

Expand Down Expand Up @@ -133,13 +123,13 @@ test-php-unit-dbg: $(composer_deps)
.PHONY: test-php-style
test-php-style: ## Run php-cs-fixer and check owncloud code-style
test-php-style: vendor-bin/owncloud-codestyle/vendor vendor-bin/php_codesniffer/vendor
$(PHP_CS_FIXER) fix -v --diff --diff-format udiff --allow-risky yes --dry-run
$(PHP_CS_FIXER) fix -v --diff --allow-risky yes --dry-run
$(PHP_CODESNIFFER) --runtime-set ignore_warnings_on_exit --standard=phpcs.xml tests/acceptance

.PHONY: test-php-style-fix
test-php-style-fix: ## Run php-cs-fixer and fix code style issues
test-php-style-fix: vendor-bin/owncloud-codestyle/vendor
$(PHP_CS_FIXER) fix -v --diff --diff-format udiff --allow-risky yes
$(PHP_CS_FIXER) fix -v --diff --allow-risky yes

.PHONY: test-php-phan
test-php-phan: ## Run phan
Expand Down
16 changes: 16 additions & 0 deletions appinfo/Migrations/Version20201123114127.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
namespace OCA\oauth2\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Types;
use OCP\Migration\ISchemaMigration;

class Version20201123114127 implements ISchemaMigration {
public function changeSchema(Schema $schema, array $options) {
$prefix = $options['tablePrefix'];
$table = $schema->getTable("{$prefix}oauth2_clients");
if (!$table->hasColumn('trusted')) {
$table->addColumn('trusted', Types::BOOLEAN, ['notNull' => true, 'default' => false]);
}
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
],
"config" : {
"platform": {
"php": "7.1"
"php": "7.3"
}
},
"require": {
Expand Down
6 changes: 3 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 16 additions & 3 deletions l10n/cs_CZ.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
OC.L10N.register(
"oauth2",
{
"The application \"{app}\" is requesting access to your account. To authorize it, please log in first." : "Aplikace \"{app}\" vyžaduje přístup k Vašemu účtu. K jejímu povolení se nejprve přihlaste.",
"Deleting..." : "Mažu...",
"Saving..." : "Ukládám...",
"Name must not be empty" : "Jméno nesmí být prázdné",
"Redirect URI must not be empty" : "Adresa přesměrování nesmí být prázdná",
"Redirect URI must be a valid URL" : "Adresa přesměrování musí být platnou URL adresou",
"Name %s already exists" : "Jméno %s již existuje",
"Client id must be a number" : "Client id musí být číslo",
"The application was authorized successfully. You can now close this window." : "Aplikace byla úspěšně autorizována. Můžete nyní zavřít toto okno.",
"Request not valid" : "Neplatný požadavek",
"This request is not valid. Please contact the administrator if this error persists." : "Neplatný požadavek. Prosím kontaktujte administrátora, pokud chyba přetrvává.",
"Back" : "Zpět",
"This request is not valid. Please contact the administrator of “%s” if this error persists." : "Neplatný požadavek. Prosím kontaktujte administrátora z \"%s\", pokud chyba přetrvává.",
"The “%s“ application would like permission to access your account" : "Aplikace \"%s\" vyžaduje přístup k Vašemu účtu",
"You are logged in as %s." : "Jste přihlášen jako %s.",
"The application will gain access to your username and will be allowed to manage files, folders and shares." : "Aplikace získá přístup vaším uživatelským jménem a bude moci spravovat soubory, složky a sdílení.",
"Authorize" : "Povolit",
"Switch users to continue" : "Přepnout uživatele pro pokračování",
"OAuth 2.0" : "OAuth 2.0",
"Registered clients" : "Registrovaní klienti",
"No clients registered." : "Žádní registrovaní klienti.",
Expand All @@ -14,12 +26,13 @@ OC.L10N.register(
"Client Identifier" : "Identifikátor klienta",
"Secret" : "Tajemství",
"Subdomains allowed" : "Subdomény povoleny",
"Are you sure you want to delete this item?" : "Jste si jistí, že chcete tyto položky smazat?",
"Add client" : "Přidat klienta",
"Allow subdomains" : "Povolené subdomény",
"Add" : "Přidat",
"Authorized Applications" : "Povolené aplikace",
"No applications authorized." : "Žádné povolené aplikace",
"Switch user" : "Přepnout uživatele"
"Are you sure you want to delete this item?" : "Jste si jistí, že chcete tyto položky smazat?",
"Switch user" : "Přepnout uživatele",
"You are logged in as %s but the application requested access for user %s." : "Jste přihlášen jako %s ale aplikace je vyžaduje oprávnění uživatele %s."
},
"nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;");
19 changes: 16 additions & 3 deletions l10n/cs_CZ.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
{ "translations": {
"The application \"{app}\" is requesting access to your account. To authorize it, please log in first." : "Aplikace \"{app}\" vyžaduje přístup k Vašemu účtu. K jejímu povolení se nejprve přihlaste.",
"Deleting..." : "Mažu...",
"Saving..." : "Ukládám...",
"Name must not be empty" : "Jméno nesmí být prázdné",
"Redirect URI must not be empty" : "Adresa přesměrování nesmí být prázdná",
"Redirect URI must be a valid URL" : "Adresa přesměrování musí být platnou URL adresou",
"Name %s already exists" : "Jméno %s již existuje",
"Client id must be a number" : "Client id musí být číslo",
"The application was authorized successfully. You can now close this window." : "Aplikace byla úspěšně autorizována. Můžete nyní zavřít toto okno.",
"Request not valid" : "Neplatný požadavek",
"This request is not valid. Please contact the administrator if this error persists." : "Neplatný požadavek. Prosím kontaktujte administrátora, pokud chyba přetrvává.",
"Back" : "Zpět",
"This request is not valid. Please contact the administrator of “%s” if this error persists." : "Neplatný požadavek. Prosím kontaktujte administrátora z \"%s\", pokud chyba přetrvává.",
"The “%s“ application would like permission to access your account" : "Aplikace \"%s\" vyžaduje přístup k Vašemu účtu",
"You are logged in as %s." : "Jste přihlášen jako %s.",
"The application will gain access to your username and will be allowed to manage files, folders and shares." : "Aplikace získá přístup vaším uživatelským jménem a bude moci spravovat soubory, složky a sdílení.",
"Authorize" : "Povolit",
"Switch users to continue" : "Přepnout uživatele pro pokračování",
"OAuth 2.0" : "OAuth 2.0",
"Registered clients" : "Registrovaní klienti",
"No clients registered." : "Žádní registrovaní klienti.",
Expand All @@ -12,12 +24,13 @@
"Client Identifier" : "Identifikátor klienta",
"Secret" : "Tajemství",
"Subdomains allowed" : "Subdomény povoleny",
"Are you sure you want to delete this item?" : "Jste si jistí, že chcete tyto položky smazat?",
"Add client" : "Přidat klienta",
"Allow subdomains" : "Povolené subdomény",
"Add" : "Přidat",
"Authorized Applications" : "Povolené aplikace",
"No applications authorized." : "Žádné povolené aplikace",
"Switch user" : "Přepnout uživatele"
"Are you sure you want to delete this item?" : "Jste si jistí, že chcete tyto položky smazat?",
"Switch user" : "Přepnout uživatele",
"You are logged in as %s but the application requested access for user %s." : "Jste přihlášen jako %s ale aplikace je vyžaduje oprávnění uživatele %s."
},"pluralForm" :"nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;"
}
4 changes: 2 additions & 2 deletions l10n/de_DE.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ OC.L10N.register(
"This request is not valid. Please contact the administrator if this error persists." : "Diese Anfrage ist nicht gültig. Bitte kontaktieren Sie den Administrator, wenn der Fehler weiterhin erscheint.",
"This request is not valid. Please contact the administrator of “%s” if this error persists." : "Diese Anfrage ist nicht gültig. Bitte kontaktieren Sie den Administrator von \"%s\", wenn der Fehler weiterhin erscheint.",
"The “%s“ application would like permission to access your account" : "Die \"%s\"-Anwendung möchte die Genehmigung zum Zugriff auf Ihr Konto",
"You are logged in as %s." : "Du bist als %s angemeldet.",
"You are logged in as %s." : "Sie sind als Benutzer %s angemeldet.",
"The application will gain access to your username and will be allowed to manage files, folders and shares." : "Die Anwendung erhält Zugriff auf Ihren Benutzernamen und die Erlaubnis, Ihre Dateien, Ordner und geteilten Inhalte zu verwalten.",
"Authorize" : "Autorisieren",
"Switch users to continue" : "Benutzer wechseln, um fortzufahren",
Expand All @@ -32,7 +32,7 @@ OC.L10N.register(
"Authorized Applications" : "Autorisierte Anwendungen",
"No applications authorized." : "Keine Anwendungen autorisiert.",
"Are you sure you want to delete this item?" : "Möchten Sie das Objekt wirklich löschen?",
"Switch user" : "Nutzer wechseln",
"Switch user" : "Benutzer wechseln",
"You are logged in as %s but the application requested access for user %s." : "Sie sind als %s angemeldet, die Anwendung benötigt aber Zugriff auf den Benutzer %s."
},
"nplurals=2; plural=(n != 1);");
4 changes: 2 additions & 2 deletions l10n/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"This request is not valid. Please contact the administrator if this error persists." : "Diese Anfrage ist nicht gültig. Bitte kontaktieren Sie den Administrator, wenn der Fehler weiterhin erscheint.",
"This request is not valid. Please contact the administrator of “%s” if this error persists." : "Diese Anfrage ist nicht gültig. Bitte kontaktieren Sie den Administrator von \"%s\", wenn der Fehler weiterhin erscheint.",
"The “%s“ application would like permission to access your account" : "Die \"%s\"-Anwendung möchte die Genehmigung zum Zugriff auf Ihr Konto",
"You are logged in as %s." : "Du bist als %s angemeldet.",
"You are logged in as %s." : "Sie sind als Benutzer %s angemeldet.",
"The application will gain access to your username and will be allowed to manage files, folders and shares." : "Die Anwendung erhält Zugriff auf Ihren Benutzernamen und die Erlaubnis, Ihre Dateien, Ordner und geteilten Inhalte zu verwalten.",
"Authorize" : "Autorisieren",
"Switch users to continue" : "Benutzer wechseln, um fortzufahren",
Expand All @@ -30,7 +30,7 @@
"Authorized Applications" : "Autorisierte Anwendungen",
"No applications authorized." : "Keine Anwendungen autorisiert.",
"Are you sure you want to delete this item?" : "Möchten Sie das Objekt wirklich löschen?",
"Switch user" : "Nutzer wechseln",
"Switch user" : "Benutzer wechseln",
"You are logged in as %s but the application requested access for user %s." : "Sie sind als %s angemeldet, die Anwendung benötigt aber Zugriff auf den Benutzer %s."
},"pluralForm" :"nplurals=2; plural=(n != 1);"
}
7 changes: 7 additions & 0 deletions l10n/el.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ OC.L10N.register(
"The application \"{app}\" is requesting access to your account. To authorize it, please log in first." : "Η εφαρμογή \"{app}\" ζητά πρόσβαση στον λογαριασμό σας. Για να την εξουσιοδοτήσετε, παρακαλούμε πρώτα συνδεθείτε.",
"Deleting..." : "Γίνεται διαγραφή...",
"Saving..." : "Γίνεται αποθήκευση...",
"Name must not be empty" : "Το όνομα δεν πρέπει να είναι κενό",
"Redirect URI must not be empty" : "Το URI ανακατεύθυνσης δεν πρέπει να είναι κενό",
"Redirect URI must be a valid URL" : "Το URI ανακατεύθυνσης πρέπει να είναι έγκυρο URL",
"Name %s already exists" : "Το όνομα %s υπάρχει ήδη",
"Cannot set localhost as trusted." : "Αδυναμία ορισμού localhost ως αξιόπιστου.",
"Client id must be a number" : "Το αναγνωριστικό πελάτη πρέπει να είναι αριθμός",
"The application was authorized successfully. You can now close this window." : "Η εφαρμογή εγκρίθηκε με επιτυχία. Τώρα μπορείτε να κλείσετε αυτό το παράθυρο.",
"Request not valid" : "Μη έγκυρη αίτηση",
"This request is not valid. Please contact the administrator if this error persists." : "Μη έγκυρη αίτηση. Παρακαλούμε επικοινωνήστε με τον διαχειριστή εάν το σφάλμα επιμένει.",
Expand All @@ -21,6 +27,7 @@ OC.L10N.register(
"Client Identifier" : "Αναγνωριστικό πελάτη",
"Secret" : "Μυστικό",
"Subdomains allowed" : "Επιτρέπονται υποτομείς",
"Trusted client" : "Αξιόπιστος πελάτης",
"Add client" : "Προσθήκη πελάτη",
"Allow subdomains" : "Να επιτρέπονται υποτομείς",
"Add" : "Προσθήκη",
Expand Down
Loading

0 comments on commit 50fa756

Please sign in to comment.