Skip to content

Commit

Permalink
feat(webserver): add license check
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys committed Feb 19, 2024
1 parent 9e22233 commit 4c34340
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions ee/tabby-webserver/src/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use auth::{
validate_jwt, AuthenticationService, Invitation, RefreshTokenError, RefreshTokenResponse,
RegisterError, RegisterResponse, TokenAuthError, TokenAuthResponse, User, VerifyTokenResponse,
};
use futures::TryFutureExt;
use job::{JobRun, JobService};
use juniper::{
graphql_object, graphql_value, EmptySubscription, FieldError, FieldResult, GraphQLObject,
Expand Down Expand Up @@ -72,8 +71,11 @@ pub enum CoreError {
#[error("{0}")]
Forbidden(&'static str),

#[error("Invalid ID Error")]
InvalidIDError,
#[error("Your license is not valid for this feature")]
InvalidLicense,

Check warning on line 75 in ee/tabby-webserver/src/schema/mod.rs

View workflow job for this annotation

GitHub Actions / autofix

variant `InvalidLicense` is never constructed

#[error("Invalid ID")]
InvalidID,

#[error("Invalid input parameters")]
InvalidInput(#[from] ValidationErrors),
Expand Down
2 changes: 1 addition & 1 deletion ee/tabby-webserver/src/service/dao.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl AsRowid for juniper::ID {
.decode(self)
.first()
.map(|i| *i as i32)
.ok_or(CoreError::InvalidIDError)
.ok_or(CoreError::InvalidID)
}
}

Expand Down

0 comments on commit 4c34340

Please sign in to comment.