Skip to content

Commit

Permalink
tokens: Allow token without prefix access all builds
Browse files Browse the repository at this point in the history
  • Loading branch information
barthalion committed Jan 20, 2024
1 parent 0097511 commit d1c3d36
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ impl ClaimsValidator for HttpRequest {
*/
fn has_token_prefix(&self, id: &str) -> Result<(), ApiError> {
self.validate_claims(|claims| {
if claims.prefixes.is_empty() {
return Ok(());
}
if !id_matches_one_prefix(id, &claims.prefixes)
&& !claims.apps.contains(&id.to_string())
{
Expand Down

0 comments on commit d1c3d36

Please sign in to comment.