Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Ephemeral
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Volkor Barbarian Warrior
Ephemeral
Commits
3a81865e
Verified
Commit
3a81865e
authored
9 months ago
by
Volkor Barbarian Warrior
Browse files
Options
Downloads
Patches
Plain Diff
more logging!
parent
37c5bda7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#69
passed with warnings
9 months ago
Stage: lint
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/handlers/delete_file.rs
+3
-2
3 additions, 2 deletions
src/handlers/delete_file.rs
with
3 additions
and
2 deletions
src/handlers/delete_file.rs
+
3
−
2
View file @
3a81865e
...
...
@@ -33,14 +33,15 @@ pub async fn delete_file(req: &mut Request, res: &mut Response, depot: &mut Depo
// Grab the file's owner key from the db.
let
owner
=
db
::
check_owner
(
sqlconn
,
filename
)
.await
;
debug!
(
"Deletion attempt: user: {} file owner: {:?}"
,
client_key
.uuid
,
owner
);
// Compare the client_key and owner.
let
authorized
=
match
owner
{
Ok
(
owner_key
)
=>
{
debug!
(
"Deletion attempt: user: {} file owner: {:?}"
,
client_key
.uuid
,
owner_key
);
client_key
.uuid
==
owner_key
}
Err
(
_
)
=>
false
,
};
debug!
(
"authorized: {}"
,
authorized
);
// Proceed with deletion if authorized, otherwise respond with an error.
if
authorized
{
...
...
@@ -75,6 +76,6 @@ pub async fn delete_file(req: &mut Request, res: &mut Response, depot: &mut Depo
// Invalid API Key. The API Exists, but isn't right.
}
else
{
res
.status_code
(
StatusCode
::
UNAUTHORIZED
);
res
.render
(
Text
::
Json
(
r#"{"error": "InvalidA
dmin
Key"}"#
));
res
.render
(
Text
::
Json
(
r#"{"error": "InvalidA
PI
Key"}"#
));
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment