Skip to content

Commit

Permalink
feat(gateway): temporary conditional project limit increase
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaro00 committed Nov 13, 2023
1 parent 0526233 commit f22162f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gateway/src/api/latest.rs
Expand Up @@ -208,12 +208,17 @@ async fn create_project(
AxumJson(config): AxumJson<project::Config>,
) -> Result<AxumJson<project::Response>, Error> {
let is_admin = claim.scopes.contains(&Scope::Admin);
let temporary_increase = if project_name.starts_with("cch23-") {
1
} else {
0
};
let project_limit: Option<u32> = if is_admin {
None
} else if claim.scopes.contains(&Scope::ExtraProjects) {
Some(MAX_PROJECTS_EXTRA)
Some(MAX_PROJECTS_EXTRA + temporary_increase)
} else {
Some(MAX_PROJECTS_DEFAULT)
Some(MAX_PROJECTS_DEFAULT + temporary_increase)
};

let project = service
Expand Down

0 comments on commit f22162f

Please sign in to comment.