mirror of
https://github.com/owncloud/ocis
synced 2026-04-25 17:25:21 +02:00
adding test for trying to create auth app-token for other user without impersonation env
This commit is contained in:
@@ -49,7 +49,7 @@ class AuthAppContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @When user :user creates app token with expiration time :expiration using the auth-app API
|
||||
* @When user :user creates auth-app token with expiration time :expiration using the auth-app API
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $expiration
|
||||
@@ -68,7 +68,7 @@ class AuthAppContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given user :user has created app token with expiration time :expiration using the auth-app API
|
||||
* @Given user :user has created auth-app token with expiration time :expiration using the auth-app API
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $expiration
|
||||
@@ -103,21 +103,23 @@ class AuthAppContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given the administrator has created app token for user :impersonatedUser with expiration time :expiration using the auth-app API
|
||||
* @Given user :user has created auth-app token for user :impersonatedUser with expiration time :expiration using the auth-app API
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $impersonatedUser
|
||||
* @param string $expiration
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function theAdministratorHasCreatedAppTokenWithExpirationTimeImpersonatingUserUsingTheAuthAppApi(
|
||||
public function userHasCreatedAppTokenWithExpirationTimeImpersonatingUserUsingTheAuthAppApi(
|
||||
string $user,
|
||||
string $impersonatedUser,
|
||||
string $expiration,
|
||||
): void {
|
||||
$response = AuthAppHelper::createAppAuthToken(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getAdminUsername(),
|
||||
$this->featureContext->getAdminPassword(),
|
||||
$this->featureContext->getActualUsername($user),
|
||||
$this->featureContext->getPasswordForUser($user),
|
||||
[
|
||||
"expiry" => $expiration,
|
||||
"userName" => $this->featureContext->getActualUsername($impersonatedUser)
|
||||
@@ -132,22 +134,24 @@ class AuthAppContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @When the administrator creates app token for user :impersonatedUser with expiration time :expiration using the auth-app API
|
||||
* @When /^user "([^"]*)" (?:creates|tries to create) auth-app token for user "([^"]*)" with expiration time "([^"]*)" using the auth-app API$/
|
||||
*
|
||||
* @param string $user
|
||||
* @param string $impersonatedUser
|
||||
* @param string $expiration
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function theAdministratorCreatesAppTokenForUserWithExpirationTimeViaAuthAppApi(
|
||||
public function theUserCreatesAppTokenForUserWithExpirationTimeViaAuthAppApi(
|
||||
string $user,
|
||||
string $impersonatedUser,
|
||||
string $expiration,
|
||||
): void {
|
||||
$this->featureContext->setResponse(
|
||||
AuthAppHelper::createAppAuthToken(
|
||||
$this->featureContext->getBaseUrl(),
|
||||
$this->featureContext->getAdminUsername(),
|
||||
$this->featureContext->getAdminPassword(),
|
||||
$this->featureContext->getActualUsername($user),
|
||||
$this->featureContext->getPasswordForUser($user),
|
||||
[
|
||||
"expiry" => $expiration,
|
||||
"userName" => $this->featureContext->getActualUsername($impersonatedUser)
|
||||
|
||||
Reference in New Issue
Block a user