mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 01:18:37 +00:00
Merge branch '1.6.x' into feat-free-sms-limit-authphone
This commit is contained in:
commit
16b32a1069
3 changed files with 29 additions and 0 deletions
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
|
|
@ -175,6 +175,8 @@ jobs:
|
||||||
name: Benchmark
|
name: Benchmark
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: setup
|
needs: setup
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
|
||||||
|
|
@ -506,6 +506,7 @@ App::init()
|
||||||
->setMode($mode)
|
->setMode($mode)
|
||||||
->setUserAgent($request->getUserAgent(''))
|
->setUserAgent($request->getUserAgent(''))
|
||||||
->setIP($request->getIP())
|
->setIP($request->getIP())
|
||||||
|
->setHostname($request->getHostname())
|
||||||
->setEvent($route->getLabel('audits.event', ''))
|
->setEvent($route->getLabel('audits.event', ''))
|
||||||
->setProject($project)
|
->setProject($project)
|
||||||
->setUser($user);
|
->setUser($user);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ class Audit extends Event
|
||||||
protected string $mode = '';
|
protected string $mode = '';
|
||||||
protected string $userAgent = '';
|
protected string $userAgent = '';
|
||||||
protected string $ip = '';
|
protected string $ip = '';
|
||||||
|
protected string $hostname = '';
|
||||||
|
|
||||||
public function __construct(protected Connection $connection)
|
public function __construct(protected Connection $connection)
|
||||||
{
|
{
|
||||||
|
|
@ -113,6 +114,30 @@ class Audit extends Event
|
||||||
return $this->ip;
|
return $this->ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the hostname.
|
||||||
|
*
|
||||||
|
* @param string $hostname
|
||||||
|
*
|
||||||
|
* @return self
|
||||||
|
*/
|
||||||
|
public function setHostname(string $hostname): self
|
||||||
|
{
|
||||||
|
$this->hostname = $hostname;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the hostname.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getHostname(): string
|
||||||
|
{
|
||||||
|
return $this->hostname;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes the event and sends it to the audit worker.
|
* Executes the event and sends it to the audit worker.
|
||||||
*
|
*
|
||||||
|
|
@ -136,6 +161,7 @@ class Audit extends Event
|
||||||
'ip' => $this->ip,
|
'ip' => $this->ip,
|
||||||
'userAgent' => $this->userAgent,
|
'userAgent' => $this->userAgent,
|
||||||
'event' => $this->event,
|
'event' => $this->event,
|
||||||
|
'hostname' => $this->hostname
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue