Browse Source

cleanup

pull/1955/head
Stuart Heap 4 years ago
parent
commit
d0d476f8ef
No known key found for this signature in database GPG Key ID: C753450AB379AA25
  1. 4
      migrations/mysql/2018-02-17-205753_create_collections_and_orgs/up.sql
  2. 4
      migrations/postgresql/2019-09-12-100000_create_tables/up.sql
  3. 4
      migrations/sqlite/2018-02-17-205753_create_collections_and_orgs/up.sql
  4. 4
      src/api/core/organizations.rs
  5. 1
      src/api/identity.rs
  6. 6
      src/db/models/organization.rs
  7. 2
      src/db/schemas/mysql/schema.rs
  8. 2
      src/db/schemas/postgresql/schema.rs
  9. 2
      src/db/schemas/sqlite/schema.rs

4
migrations/mysql/2018-02-17-205753_create_collections_and_orgs/up.sql

@ -14,9 +14,7 @@ CREATE TABLE organizations (
signed_out_callback_path TEXT NOT NULL, signed_out_callback_path TEXT NOT NULL,
authority TEXT NOT NULL, authority TEXT NOT NULL,
client_id TEXT NOT NULL, client_id TEXT NOT NULL,
client_secret TEXT NOT NULL, client_secret TEXT NOT NULL
metadata_address TEXT NOT NULL,
oidc_redirect_behavior TEXT NOT NULL
); );
CREATE TABLE users_collections ( CREATE TABLE users_collections (

4
migrations/postgresql/2019-09-12-100000_create_tables/up.sql

@ -42,9 +42,7 @@ CREATE TABLE organizations (
signed_out_callback_path TEXT NOT NULL, signed_out_callback_path TEXT NOT NULL,
authority TEXT NOT NULL, authority TEXT NOT NULL,
client_id TEXT NOT NULL, client_id TEXT NOT NULL,
client_secret TEXT NOT NULL, client_secret TEXT NOT NULL
metadata_address TEXT NOT NULL,
oidc_redirect_behavior TEXT NOT NULL
); );
CREATE TABLE ciphers ( CREATE TABLE ciphers (

4
migrations/sqlite/2018-02-17-205753_create_collections_and_orgs/up.sql

@ -14,9 +14,7 @@ CREATE TABLE organizations (
signed_out_callback_path TEXT NOT NULL, signed_out_callback_path TEXT NOT NULL,
authority TEXT NOT NULL, authority TEXT NOT NULL,
client_id TEXT NOT NULL, client_id TEXT NOT NULL,
client_secret TEXT NOT NULL, client_secret TEXT NOT NULL
metadata_address TEXT NOT NULL,
oidc_redirect_behavior TEXT NOT NULL
); );

4
src/api/core/organizations.rs

@ -85,8 +85,6 @@ struct OrganizationSsoUpdateData {
Authority: String, Authority: String,
ClientId: String, ClientId: String,
ClientSecret: String, ClientSecret: String,
MetadataAddress: String,
OidcRedirectBehavior: String,
} }
#[derive(Deserialize, Debug)] #[derive(Deserialize, Debug)]
@ -244,8 +242,6 @@ fn put_organization_sso(
org.authority = data.Authority; org.authority = data.Authority;
org.client_id = data.ClientId; org.client_id = data.ClientId;
org.client_secret = data.ClientSecret; org.client_secret = data.ClientSecret;
org.metadata_address = data.MetadataAddress;
org.oidc_redirect_behavior = data.OidcRedirectBehavior;
org.save(&conn)?; org.save(&conn)?;
Ok(Json(org.to_json())) Ok(Json(org.to_json()))

1
src/api/identity.rs

@ -573,7 +573,6 @@ fn get_client_from_identifier (identifier: &str, conn: &DbConn) -> CoreClient {
match organization { match organization {
Some(organization) => { Some(organization) => {
let redirect = organization.callback_path.to_string(); let redirect = organization.callback_path.to_string();
let issuer = reqwest::Url::parse(&organization.authority).unwrap();
let client_id = ClientId::new(organization.client_id); let client_id = ClientId::new(organization.client_id);
let client_secret = ClientSecret::new(organization.client_secret); let client_secret = ClientSecret::new(organization.client_secret);
let issuer_url = IssuerUrl::new(organization.authority).expect("invalid issuer URL"); let issuer_url = IssuerUrl::new(organization.authority).expect("invalid issuer URL");

6
src/db/models/organization.rs

@ -21,8 +21,6 @@ db_object! {
pub authority: String, pub authority: String,
pub client_id: String, pub client_id: String,
pub client_secret: String, pub client_secret: String,
pub metadata_address: String,
pub oidc_redirect_behavior: String,
} }
#[derive(Identifiable, Queryable, Insertable, AsChangeset)] #[derive(Identifiable, Queryable, Insertable, AsChangeset)]
@ -147,8 +145,6 @@ impl Organization {
authority: String::from(""), authority: String::from(""),
client_id: String::from(""), client_id: String::from(""),
client_secret: String::from(""), client_secret: String::from(""),
metadata_address: String::from(""),
oidc_redirect_behavior: String::from(""),
} }
} }
@ -189,8 +185,6 @@ impl Organization {
"Authority": self.authority, "Authority": self.authority,
"ClientId": self.client_id, "ClientId": self.client_id,
"ClientSecret": self.client_secret, "ClientSecret": self.client_secret,
"MetadataAddress": self.metadata_address,
"OidcRedirectBehavior": self.oidc_redirect_behavior,
}) })
} }
} }

2
src/db/schemas/mysql/schema.rs

@ -109,8 +109,6 @@ table! {
authority -> Text, authority -> Text,
client_id -> Text, client_id -> Text,
client_secret -> Text, client_secret -> Text,
metadata_address -> Text,
oidc_redirect_behavior -> Text,
} }
} }

2
src/db/schemas/postgresql/schema.rs

@ -109,8 +109,6 @@ table! {
authority -> Text, authority -> Text,
client_id -> Text, client_id -> Text,
client_secret -> Text, client_secret -> Text,
metadata_address -> Text,
oidc_redirect_behavior -> Text,
} }
} }

2
src/db/schemas/sqlite/schema.rs

@ -109,8 +109,6 @@ table! {
authority -> Text, authority -> Text,
client_id -> Text, client_id -> Text,
client_secret -> Text, client_secret -> Text,
metadata_address -> Text,
oidc_redirect_behavior -> Text,
} }
} }

Loading…
Cancel
Save