Browse Source
			
			
			Merge pull request #987 from theycallmesteve/global_domains
			
				GlobalEquivalentDomains updates from upstream bitwarden
			
			
				pull/990/head
			
			
		 
		
			
				
					
						
						Daniel García
					
					6 years ago
					
						
							committed by
							
								
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: 4AEE18F83AFDEB23
						
					
				
			
		
		
		
	
		
			
				 6 changed files with 
73 additions and 
78 deletions
			 
			
		 
		
			
				- 
					
					
					 
					src/api/core/ciphers.rs
				
 
			
				- 
					
					
					 
					src/api/core/two_factor/authenticator.rs
				
 
			
				- 
					
					
					 
					src/config.rs
				
 
			
				- 
					
					
					 
					src/db/models/device.rs
				
 
			
				- 
					
					
					 
					src/static/global_domains.json
				
 
			
		
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
					@ -767,11 +767,7 @@ fn post_attachment_admin( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    post_attachment(uuid, data, content_type, headers, conn, nt) | 
					 | 
					 | 
					    post_attachment(uuid, data, content_type, headers, conn, nt) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					} | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					#[post(
 | 
					 | 
					 | 
					#[post("/ciphers/<uuid>/attachment/<attachment_id>/share", format = "multipart/form-data", data = "<data>")] | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					    "/ciphers/<uuid>/attachment/<attachment_id>/share", | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    format = "multipart/form-data", | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    data = "<data>" | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					)] | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					fn post_attachment_share( | 
					 | 
					 | 
					fn post_attachment_share( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    uuid: String, | 
					 | 
					 | 
					    uuid: String, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    attachment_id: String, | 
					 | 
					 | 
					    attachment_id: String, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
					@ -20,6 +20,7 @@ pub fn routes() -> Vec<Route> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        activate_authenticator_put, | 
					 | 
					 | 
					        activate_authenticator_put, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    ] | 
					 | 
					 | 
					    ] | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					} | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					#[post("/two-factor/get-authenticator", data = "<data>")] | 
					 | 
					 | 
					#[post("/two-factor/get-authenticator", data = "<data>")] | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					fn generate_authenticator(data: JsonUpcase<PasswordData>, headers: Headers, conn: DbConn) -> JsonResult { | 
					 | 
					 | 
					fn generate_authenticator(data: JsonUpcase<PasswordData>, headers: Headers, conn: DbConn) -> JsonResult { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    let data: PasswordData = data.into_inner().data; | 
					 | 
					 | 
					    let data: PasswordData = data.into_inner().data; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
					@ -135,7 +135,6 @@ macro_rules! make_config { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    (inner._env.build(), inner.config.clone()) | 
					 | 
					 | 
					                    (inner._env.build(), inner.config.clone()) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                }; | 
					 | 
					 | 
					                }; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                fn _get_form_type(rust_type: &str) -> &'static str { | 
					 | 
					 | 
					                fn _get_form_type(rust_type: &str) -> &'static str { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    match rust_type { | 
					 | 
					 | 
					                    match rust_type { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        "Pass" => "password", | 
					 | 
					 | 
					                        "Pass" => "password", | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
					@ -77,7 +77,6 @@ impl Device { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        let orguser: Vec<_> = orgs.iter().filter(|o| o.atype == 2).map(|o| o.org_uuid.clone()).collect(); | 
					 | 
					 | 
					        let orguser: Vec<_> = orgs.iter().filter(|o| o.atype == 2).map(|o| o.org_uuid.clone()).collect(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        let orgmanager: Vec<_> = orgs.iter().filter(|o| o.atype == 3).map(|o| o.org_uuid.clone()).collect(); | 
					 | 
					 | 
					        let orgmanager: Vec<_> = orgs.iter().filter(|o| o.atype == 3).map(|o| o.org_uuid.clone()).collect(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        // Create the JWT claims struct, to send to the client
 | 
					 | 
					 | 
					        // Create the JWT claims struct, to send to the client
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        use crate::auth::{encode_jwt, LoginJWTClaims, DEFAULT_VALIDITY, JWT_LOGIN_ISSUER}; | 
					 | 
					 | 
					        use crate::auth::{encode_jwt, LoginJWTClaims, DEFAULT_VALIDITY, JWT_LOGIN_ISSUER}; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        let claims = LoginJWTClaims { | 
					 | 
					 | 
					        let claims = LoginJWTClaims { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  | 
				
			
			
		
	
								
							
						
					 
					
				 
			 
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
					@ -108,7 +108,9 @@ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      "microsoftonline.com", | 
					 | 
					 | 
					      "microsoftonline.com", | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      "office365.com", | 
					 | 
					 | 
					      "office365.com", | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      "microsoftstore.com", | 
					 | 
					 | 
					      "microsoftstore.com", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					      "xbox.com" | 
					 | 
					 | 
					      "xbox.com", | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      "azure.com", | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      "windowsazure.com" | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    ], | 
					 | 
					 | 
					    ], | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    "Excluded": false | 
					 | 
					 | 
					    "Excluded": false | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  }, | 
					 | 
					 | 
					  }, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -126,8 +128,7 @@ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    "Type": 12, | 
					 | 
					 | 
					    "Type": 12, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    "Domains": [ | 
					 | 
					 | 
					    "Domains": [ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      "overture.com", | 
					 | 
					 | 
					      "overture.com", | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					      "yahoo.com", | 
					 | 
					 | 
					      "yahoo.com" | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					      "flickr.com" | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    ], | 
					 | 
					 | 
					    ], | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    "Excluded": false | 
					 | 
					 | 
					    "Excluded": false | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  }, | 
					 | 
					 | 
					  }, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -192,7 +193,6 @@ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      "amazon.it", | 
					 | 
					 | 
					      "amazon.it", | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      "amazon.com.au", | 
					 | 
					 | 
					      "amazon.com.au", | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      "amazon.co.nz", | 
					 | 
					 | 
					      "amazon.co.nz", | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      "amazon.co.jp", | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      "amazon.in" | 
					 | 
					 | 
					      "amazon.in" | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    ], | 
					 | 
					 | 
					    ], | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    "Excluded": false | 
					 | 
					 | 
					    "Excluded": false | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |