Skip to content

Commit

Permalink
Remove set_private_key (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
pnmadelaine authored Feb 11, 2024
1 parent 6c06d6a commit a9e98e5
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion typhon-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ pub fn handle_request_aux(
requests::Project::Info => return Ok(Response::ProjectInfo(project.info(conn)?)),
requests::Project::Refresh => project.refresh(conn)?,
requests::Project::SetDecl(decl) => project.set_decl(conn, decl)?,
requests::Project::SetPrivateKey(key) => project.set_private_key(conn, &key)?,
requests::Project::UpdateJobsets => project.update_jobsets(conn)?,
};
Response::Ok
Expand Down
9 changes: 0 additions & 9 deletions typhon-core/src/projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,6 @@ impl Project {
Ok(())
}

pub fn set_private_key(&self, conn: &mut Conn, key: &String) -> Result<(), Error> {
let _ = age::x25519::Identity::from_str(key).map_err(|_| Error::Todo)?;
diesel::update(&self.project)
.set(schema::projects::key.eq(key))
.execute(conn)?;
log_event(Event::ProjectUpdated(self.handle()));
Ok(())
}

pub fn update_jobsets(&self, conn: &mut Conn) -> Result<(), Error> {
// run action `jobsets`
let action = self.new_action(
Expand Down
1 change: 0 additions & 1 deletion typhon-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ pub mod requests {
Info,
Refresh,
SetDecl(ProjectDecl),
SetPrivateKey(String),
UpdateJobsets,
}

Expand Down
7 changes: 0 additions & 7 deletions typhon/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,6 @@ r!(
Project::SetDecl(body.into_inner()),
);

project_set_private_key(path: web::Path<String>, body: web::Json<String>) =>
Request::Project(
handles::project(path.into_inner()),
Project::SetPrivateKey(body.into_inner()),
);

project_update_jobsets(path: web::Path<String>) =>
Request::Project(
handles::project(path.into_inner()),
Expand Down Expand Up @@ -353,7 +347,6 @@ pub fn config(cfg: &mut web::ServiceConfig) {
.route("/refresh", web::post().to(project_refresh))
.route("/update_jobsets", web::post().to(project_update_jobsets))
.route("/set_decl", web::post().to(project_set_decl))
.route("/set_private_key", web::post().to(project_set_private_key))
.route("/webhook", web::post().to(webhook))
.service(
web::scope("/jobsets/{jobset}")
Expand Down

0 comments on commit a9e98e5

Please sign in to comment.