-
Notifications
You must be signed in to change notification settings - Fork 69
Self-signed certificate support #2270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
67d2585
Implement initial question to import certificate
jreidinger 31b1e37
Merge remote-tracking branch 'origin/master' into initial_certificates
jreidinger 72873ff
experiment with paragraphs
jreidinger abf9ff0
add fingerprint storage and use it in registration
jreidinger 65ceb8d
service: add data to certificate question
joseivanlopez 5946bbb
allow registration url be redefined and also add ssl fingerprints
jreidinger 930f816
update dbus doc and fix typo
jreidinger a57e474
add proxies for security
jreidinger 7b65d88
Add registration url to rust part
jreidinger 6901bae
implement for security in rust part that communicate with dbus
jreidinger 48e5991
service: fix registration certificate question
joseivanlopez 4cb3cf9
web: add question for registration certificate
joseivanlopez 41663b2
Merge remote-tracking branch 'origin/master' into initial_certificates
jreidinger 90d795d
add web part of security
jreidinger d8c0b16
rename key in profile
jreidinger 9354ceb
apply clippy suggestion
jreidinger f1b0180
make rubocop happy
jreidinger 6d0d98a
fix rust unit test
jreidinger 64ba358
adjust dbus doc to make ci happy
jreidinger 9214f64
Apply suggestions from code review
jreidinger caa3559
changes from code review
jreidinger 6696dee
changes from review
jreidinger 22a03c9
cargo fmt
jreidinger 6eb69ae
changes
jreidinger 2fa3f3d
Apply suggestions from code review
jreidinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| org.opensuse.Agama.Software1.bus.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <node name="/org/opensuse/Agama/Software1"> | ||
| <node name="Product"></node> | ||
| <node name="Proposal"></node> | ||
| <interface name="org.opensuse.Agama.Security"> | ||
| <property type="a(ss)" name="SslFingerprints" access="readwrite"/> | ||
| </interface> | ||
| </node> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| pub mod client; | ||
| pub mod http_client; | ||
| pub mod model; | ||
| pub mod proxies; | ||
| pub mod settings; | ||
| pub mod store; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| // Copyright (c) [2025] SUSE LLC | ||
| // | ||
| // All Rights Reserved. | ||
| // | ||
| // This program is free software; you can redistribute it and/or modify it | ||
| // under the terms of the GNU General Public License as published by the Free | ||
| // Software Foundation; either version 2 of the License, or (at your option) | ||
| // any later version. | ||
| // | ||
| // This program is distributed in the hope that it will be useful, but WITHOUT | ||
| // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| // more details. | ||
| // | ||
| // You should have received a copy of the GNU General Public License along | ||
| // with this program; if not, contact SUSE LLC. | ||
| // | ||
| // To contact SUSE LLC about this file by physical or electronic mail, you may | ||
| // find current contact information at www.suse.com. | ||
|
|
||
| use std::str::FromStr; | ||
|
|
||
| use zbus::Connection; | ||
|
|
||
| use crate::error::ServiceError; | ||
|
|
||
| use super::{ | ||
| model::{SSLFingerprint, SSLFingerprintAlgorithm}, | ||
| proxies::SecurityProxy, | ||
| }; | ||
|
|
||
| /// D-Bus client for the security service | ||
| #[derive(Clone)] | ||
| pub struct SecurityClient<'a> { | ||
| security_proxy: SecurityProxy<'a>, | ||
| } | ||
|
|
||
| impl SecurityClient<'_> { | ||
| pub async fn new(connection: Connection) -> Result<Self, ServiceError> { | ||
| Ok(Self { | ||
| security_proxy: SecurityProxy::new(&connection).await?, | ||
| }) | ||
| } | ||
|
|
||
| pub async fn get_ssl_fingerprints(&self) -> Result<Vec<SSLFingerprint>, ServiceError> { | ||
| let dbus_list = self.security_proxy.ssl_fingerprints().await?; | ||
| dbus_list | ||
| .into_iter() | ||
| .map(|(alg, value)| { | ||
| Ok(SSLFingerprint { | ||
| fingerprint: value, | ||
| algorithm: SSLFingerprintAlgorithm::from_str(&alg)?, | ||
| }) | ||
| }) | ||
| .collect() | ||
| } | ||
|
|
||
| pub async fn set_ssl_fingerprints( | ||
| &self, | ||
| list: &Vec<SSLFingerprint>, | ||
| ) -> Result<(), ServiceError> { | ||
| let dbus_list: Vec<(&str, &str)> = list | ||
| .iter() | ||
| .map(|s| (s.algorithm.into(), s.fingerprint.as_str())) | ||
| .collect(); | ||
| self.security_proxy.set_ssl_fingerprints(&dbus_list).await?; | ||
| Ok(()) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| // Copyright (c) [2025] SUSE LLC | ||
| // | ||
| // All Rights Reserved. | ||
| // | ||
| // This program is free software; you can redistribute it and/or modify it | ||
| // under the terms of the GNU General Public License as published by the Free | ||
| // Software Foundation; either version 2 of the License, or (at your option) | ||
| // any later version. | ||
| // | ||
| // This program is distributed in the hope that it will be useful, but WITHOUT | ||
| // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| // more details. | ||
| // | ||
| // You should have received a copy of the GNU General Public License along | ||
| // with this program; if not, contact SUSE LLC. | ||
| // | ||
| // To contact SUSE LLC about this file by physical or electronic mail, you may | ||
| // find current contact information at www.suse.com. | ||
|
|
||
| use crate::{base_http_client::BaseHTTPClient, error::ServiceError}; | ||
|
|
||
| use super::model::SSLFingerprint; | ||
|
|
||
| pub struct SecurityHTTPClient { | ||
| client: BaseHTTPClient, | ||
| } | ||
|
|
||
| impl SecurityHTTPClient { | ||
| pub fn new(base: BaseHTTPClient) -> Self { | ||
| Self { client: base } | ||
| } | ||
|
|
||
| pub async fn get_ssl_fingerprints(&self) -> Result<Vec<SSLFingerprint>, ServiceError> { | ||
| self.client.get("/security/ssl_fingerprints").await | ||
| } | ||
|
|
||
| pub async fn set_ssl_fingerprints( | ||
| &self, | ||
| fps: &Vec<SSLFingerprint>, | ||
| ) -> Result<(), ServiceError> { | ||
| self.client | ||
| .put_void("/security/ssl_fingerprints", fps) | ||
| .await | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks weird to me to have separate endpoints to set the registration code/email and the URL.
Perhaps in the future we might consider to add the URL to the registration params.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeap, but code+email is together registration...not sure if it should be also part of registration method param and expect that all following registration of addons is forced to be on identical url.