diff --git a/public/TokenManager.php b/public/TokenManager.php new file mode 100644 index 0000000..0eee6da --- /dev/null +++ b/public/TokenManager.php @@ -0,0 +1,66 @@ +storagePath = $storagePath; + $this->$expireDays = $expireDays; + $this->$maxDownloads = $maxDownloads; + $this->$tokenLength = $tokenLength; + } + + // generate a new token and save it to the file system + public generateToken( + string $filename, + string $ownerName, + string $allowedUser + ) { + return (['error'=>'no token generated', 'status'=>'500']); + } + + // retrieve/download the key file connected with the token + public retrieveToken(string $tokenName) { + + } + + // check a token and remove it when it's expired + public cleanupToken(string $tokenName) { + + } + + /* + * PRIVATE FUNCTIONS + */ + + // check whether a token is still valid and accessible by the user requesting it + private validateToken($tokenName) { + return null; + } + + private getDownloadFileInfo ($tokenName) { + $fileInfo = []; + return null; + } +} \ No newline at end of file