Browse Source

Merge branch 'initial-ldap-support' of github.com:liberodark/bitwarden_rs into initial-ldap-support

pull/677/head
unknown 6 years ago
parent
commit
666181d4c9
  1. 2
      README.md
  2. 2
      src/api/identity.rs
  3. 4
      src/ldap.rs
  4. 14
      src/static/scripts/bootstrap-native-v4.js
  5. 2
      src/static/scripts/md5.js

2
README.md

@ -5,6 +5,7 @@
[![Travis Build Status](https://travis-ci.org/dani-garcia/bitwarden_rs.svg?branch=master)](https://travis-ci.org/dani-garcia/bitwarden_rs) [![Travis Build Status](https://travis-ci.org/dani-garcia/bitwarden_rs.svg?branch=master)](https://travis-ci.org/dani-garcia/bitwarden_rs)
[![Docker Pulls](https://img.shields.io/docker/pulls/bitwardenrs/server.svg)](https://hub.docker.com/r/bitwardenrs/server) [![Docker Pulls](https://img.shields.io/docker/pulls/bitwardenrs/server.svg)](https://hub.docker.com/r/bitwardenrs/server)
[![Dependency Status](https://deps.rs/repo/github/dani-garcia/bitwarden_rs/status.svg)](https://deps.rs/repo/github/dani-garcia/bitwarden_rs) [![Dependency Status](https://deps.rs/repo/github/dani-garcia/bitwarden_rs/status.svg)](https://deps.rs/repo/github/dani-garcia/bitwarden_rs)
[![Code Status](https://www.codefactor.io/repository/github/liberodark/bitwarden_rs/badge)](https://www.codefactor.io/repository/github/liberodark/bitwarden_rs)
[![GitHub Release](https://img.shields.io/github/release/dani-garcia/bitwarden_rs.svg)](https://github.com/dani-garcia/bitwarden_rs/releases/latest) [![GitHub Release](https://img.shields.io/github/release/dani-garcia/bitwarden_rs.svg)](https://github.com/dani-garcia/bitwarden_rs/releases/latest)
[![GPL-3.0 Licensed](https://img.shields.io/github/license/dani-garcia/bitwarden_rs.svg)](https://github.com/dani-garcia/bitwarden_rs/blob/master/LICENSE.txt) [![GPL-3.0 Licensed](https://img.shields.io/github/license/dani-garcia/bitwarden_rs.svg)](https://github.com/dani-garcia/bitwarden_rs/blob/master/LICENSE.txt)
[![Matrix Chat](https://img.shields.io/matrix/bitwarden_rs:matrix.org.svg?logo=matrix)](https://matrix.to/#/#bitwarden_rs:matrix.org) [![Matrix Chat](https://img.shields.io/matrix/bitwarden_rs:matrix.org.svg?logo=matrix)](https://matrix.to/#/#bitwarden_rs:matrix.org)
@ -29,6 +30,7 @@ Basically full implementation of Bitwarden API is provided including:
* Website icons API * Website icons API
* Authenticator and U2F support * Authenticator and U2F support
* YubiKey OTP * YubiKey OTP
* LDAP support
## Installation ## Installation
Pull the docker image and mount a volume from the host for persistent storage: Pull the docker image and mount a volume from the host for persistent storage:

2
src/api/identity.rs

@ -96,7 +96,7 @@ fn _password_login(data: ConnectData, conn: DbConn, ip: ClientIp) -> JsonResult
// Attempt to bind to ldap with these credentials // Attempt to bind to ldap with these credentials
match LdapConn::new(CONFIG.ldap_host().as_str()) { match LdapConn::new(CONFIG.ldap_host().as_str()) {
Ok(ldap) => { Ok(ldap) => {
let bind = ldap.simple_bind(ldap_username, password)?.success(); let bind = ldap.simple_bind(ldap_username, password)?.non_error();
if bind.is_err() { if bind.is_err() {
err!( err!(

4
src/ldap.rs

@ -18,8 +18,8 @@ pub fn launch_ldap_connector() {
loop { loop {
if CONFIG._enable_ldap() { if CONFIG._enable_ldap() {
match sync_from_ldap(&conn) { match sync_from_ldap(&conn) {
Err(_) => println!("Couldn't sync from LDAP, check LDAP config"), Ok(_) => println!("Successfully synced LDAP users"),
_ => {} Err(error) => println!("Couldn't sync from LDAP, check LDAP config : {:?}", error),
} }
} }
sleep(interval); sleep(interval);

14
src/static/scripts/bootstrap-native-v4.js

@ -1282,7 +1282,7 @@
if ( !!element && !(stringModal in element) ) { if ( !!element && !(stringModal in element) ) {
on(element, clickEvent, clickHandler); on(element, clickEvent, clickHandler);
} }
if ( !!self[content] ) { self.setContent( self[content] ); } if ( self[content] ) { self.setContent( self[content] ); }
if (element) { element[stringModal] = self; modal[modalTrigger] = element; } if (element) { element[stringModal] = self; modal[modalTrigger] = element; }
else { modal[stringModal] = self; } else { modal[stringModal] = self; }
}; };
@ -1372,7 +1372,7 @@
titleString = options.title || element[getAttribute](dataTitle); titleString = options.title || element[getAttribute](dataTitle);
contentString = options.content || element[getAttribute](dataContent); contentString = options.content || element[getAttribute](dataContent);
// fixing https://github.com/thednp/bootstrap.native/issues/233 // fixing https://github.com/thednp/bootstrap.native/issues/233
contentString = !!contentString ? contentString.trim() : null; contentString = contentString ? contentString.trim() : null;
popover = DOC[createElement](div); popover = DOC[createElement](div);
@ -1452,7 +1452,7 @@
updatePopover(); updatePopover();
showPopover(); showPopover();
bootstrapCustomEvent.call(element, showEvent, component); bootstrapCustomEvent.call(element, showEvent, component);
!!self[animation] ? emulateTransitionEnd(popover, showTrigger) : showTrigger(); self[animation] ? emulateTransitionEnd(popover, showTrigger) : showTrigger();
} }
}, 20 ); }, 20 );
}; };
@ -1462,7 +1462,7 @@
if (popover && popover !== null && hasClass(popover,showClass)) { if (popover && popover !== null && hasClass(popover,showClass)) {
bootstrapCustomEvent.call(element, hideEvent, component); bootstrapCustomEvent.call(element, hideEvent, component);
removeClass(popover,showClass); removeClass(popover,showClass);
!!self[animation] ? emulateTransitionEnd(popover, hideTrigger) : hideTrigger(); self[animation] ? emulateTransitionEnd(popover, hideTrigger) : hideTrigger();
} }
}, self[delay] ); }, self[delay] );
}; };
@ -1516,7 +1516,7 @@
for (var i=0, il=links[length]; i<il; i++) { for (var i=0, il=links[length]; i<il; i++) {
var href = links[i][getAttribute]('href'), var href = links[i][getAttribute]('href'),
targetItem = href && href.charAt(0) === '#' && href.slice(-1) !== '#' && queryElement(href); targetItem = href && href.charAt(0) === '#' && href.slice(-1) !== '#' && queryElement(href);
if ( !!targetItem ) { if ( targetItem ) {
items[push](links[i]); items[push](links[i]);
targetItems[push](targetItem); targetItems[push](targetItem);
} }
@ -1940,7 +1940,7 @@
updateTooltip(); updateTooltip();
showTooltip(); showTooltip();
bootstrapCustomEvent.call(element, showEvent, component); bootstrapCustomEvent.call(element, showEvent, component);
!!self[animation] ? emulateTransitionEnd(tooltip, showTrigger) : showTrigger(); self[animation] ? emulateTransitionEnd(tooltip, showTrigger) : showTrigger();
} }
} }
}, 20 ); }, 20 );
@ -1951,7 +1951,7 @@
if (tooltip && hasClass(tooltip,showClass)) { if (tooltip && hasClass(tooltip,showClass)) {
bootstrapCustomEvent.call(element, hideEvent, component); bootstrapCustomEvent.call(element, hideEvent, component);
removeClass(tooltip,showClass); removeClass(tooltip,showClass);
!!self[animation] ? emulateTransitionEnd(tooltip, hideTrigger) : hideTrigger(); self[animation] ? emulateTransitionEnd(tooltip, hideTrigger) : hideTrigger();
} }
}, self[delay]); }, self[delay]);
}; };

2
src/static/scripts/md5.js

@ -21,7 +21,7 @@
/* eslint-disable strict */ /* eslint-disable strict */
;(function($) { (function($) {
'use strict' 'use strict'
/** /**

Loading…
Cancel
Save