Skip to content

Commit

Permalink
Merge pull request #132 from waifuvault/hide-secret-toekn-from-doc
Browse files Browse the repository at this point in the history
hide `secret_token`
  • Loading branch information
VictoriqueMoe authored Mar 22, 2024
2 parents 76920d1 + 7920c84 commit d317c93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/controllers/rest/impl/FileUploadController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,15 @@ export class FileUploadController extends BaseRestController {
const ip = NetworkUtils.getIp(req);
let uploadModelResponse: FileUploadResponseDto;
let alreadyExists: boolean;
const secretToken = req.query["secret_token"]?.toString();
try {
[uploadModelResponse, alreadyExists] = await this.fileUploadService.processUpload(
ip,
url || file!,
params.expires,
params.hide_filename,
params.hideFilename,
params.password,
params.secret_token,
secretToken,
);
} catch (e) {
this.logger.error(e.message);
Expand Down
8 changes: 2 additions & 6 deletions src/model/rest/FileUploadParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,13 @@ export class FileUploadParameters {
)
@Optional()
@Property()
public hide_filename?: boolean;
@Name("hide_filename")
public hideFilename?: boolean;

@Description(
"Set a password for this file, this will encrypt the file on the server that not even the server owner can obtain it, when fetching the file. you can fill out the `x-password` http header with your password to obtain the file via API",
)
@Optional()
@Property()
public password?: string;

@Description("Shh, it's a secret ;)")
@Optional()
@Property()
public secret_token?: string;
}

0 comments on commit d317c93

Please sign in to comment.