• Stars
    star
    180
  • Rank 206,613 (Top 5 %)
  • Language
    Swift
  • License
    Other
  • Created over 1 year ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐ŸŽ Apple applications sources

Apple apps

This repository contains the source code for all the Apple applications (Dashlane iOS, Dashlane macOS, Authenticator). It is publicly available for everyone to audit our code and learn more about how the Apple applications work.

History

The iOS project was started back in 2010 and was relying on Objective-C, C++, and UIKit. Throughout the years, we transitioned to Swift to have a more modern codebase. Today, we don't have any Objective-C code anymore. After Apple announced SwiftUI in 2019, we decided to rewrite the app with this technology. Today, most of our codebase uses the latest Apple technologies like SwiftUI and Swift Concurrency.

High-level architecture

The architecture pattern used for the views is MVVM. It helps us isolate the business logic in clear layers and components.

Because we were using a UIKit-based navigation, we relied on the Coordinator pattern to push the different views in the flows. These components are fading away as we're replacing the navigation with a SwiftUI-based one, relying only on MVVM.

We rely on small services to perform non-UI operations (VaultItemService, RegionInformationService, PasswordEvaluator, ...). These services are split into two categories, the ones available when the user is not authenticated, and the others that require user information. They are respectively instantiated in AppServicesContainer and SessionServicesContainer.

These services all define protocols for their public interface, clearly defining what should be public and what should not. Using protocols makes it easier to define Mocks and use them in Unit Tests and SwiftUI Previews.

SwiftUI

We have been early adopters of the technology, using the first version of SwiftUI in production. While we still have a few screens written in UIKit, most of the codebase uses SwiftUI.

The main navigation relies on UIKit because of the lack of features in the SwiftUI navigation when we introduced it. We started replacing it in some flows (like in the Settings or the Login) with the SwiftUI Navigation. We aim to finish the migration this year, allowing us to fully benefit from the SwiftUI environment.

Swift Concurrency

Swift Concurrency has been longly awaited in the Swift community. All our Services relied on Combine to provide async information. Most of them have been migrated to Swift Concurrency, allowing a simpler codebase.

The migration is still happening. We're regularly updating the services to use Swift Concurrency.

Codebase organization

The codebase is a monorepo, meaning that all Apple applications are in a single repository. It brings us many advantages as we share code between our applications. At the repository's root is a folder per target/app and one for all our Packages. Before using a monorepo, adding code in packages was difficult because they were in other repositories. Developers had to create multiple merge requests to add their code if it impacted different parts of the applications. It led to the Shared folder that contains files used by multiple targets. It was easy to add code there. As we migrate most of our features in Packages, the Shared folder will disappear. We stopped adding code in this folder a few months ago, but removing it will take some time.

Cryptography

All cryptographic operations are based on the Apple frameworks CommonCrypto and CryptoKit.

The derivation of the Master Password is performed with the Password Hashing Competition winner, Argon2. The codebase contains a Swift wrapper that uses the C implementation of the algorithm.

If you want to learn more about cryptography at Dashlane, have a look at our Security Whitepaper.

How to contribute

Security issue

If you find a vulnerability or a security issue, please report it on our Hacker One Bug Bounty program.

Codebase improvement

If there is an improvement for the codebase you would like to share with us, we would be happy to hear your thoughts! Feel free to open an issue on this repository or contact us at [email protected].

Get our apps

Dashlane Apps Download link
Dashlane Password Manager Download Dashlane Password Manager on App Store
Dashlane Authenticator Download Dashlane Authenticator on App Store

More Repositories

1

android-apps

๐Ÿค– Android applications sources
Kotlin
183
star
2

dashlane-cli

๐Ÿ‘ฉโ€๐Ÿ’ป Dashlane CLI - Access your secrets in your terminal, servers and CI/CD
TypeScript
170
star
3

ts-event-bus

๐Ÿ“จ Distributed messaging in TypeScript
TypeScript
138
star
4

dbt-invoke

A CLI for creating, updating, and deleting dbt property files
Python
64
star
5

SwiftDomainParser

A Full Swift Lightweight Framework that uses the Public Suffix list to Parse URLs
Swift
61
star
6

android-passkey-example

An example application that demonstrates the use of passkeys to sign up and sign in
Kotlin
54
star
7

redux-cursor

๐ŸŒ Local private slices of a global store for component encapsulation in a Redux model
TypeScript
43
star
8

chainable-data-source

Chainable Data Sources (CDS) provide a uniformized interface that plugs easily on common UIKit / Foundation components dedicated to displayed large data sets (UITableView/UICollectionView/NSFetchedResultsController), as well as a toolset to manipulate objects conforming to that interface.
Objective-C
27
star
9

password-changer-well-known

Documentation for using Dashlane's password changer .well-known
23
star
10

pqc.js

JS bindings and playground of post-quantum asymmetric ciphers
TypeScript
20
star
11

css-variables-loader

Load CSS variables with Webpack
JavaScript
11
star
12

we-are-hiring

๐Ÿ” Join Dashlane and help making digital life safer and simpler !
11
star
13

passkeys-resources

Public resources for passkeys
TypeScript
9
star
14

node-find-glob

Find files using extensive glob syntax
JavaScript
6
star
15

BijouJS

Bijou.JS - An UWP JS engine
C#
5
star
16

SAWF

Semantically Annotated Web Forms
HTML
4
star
17

react-multiple-sticky

React component to implement multiple sticky elements when parent container is scrolling
TypeScript
2
star
18

dashlane-audit-logs

Smarty
2
star
19

StashAutoArchive

This is an Atlassian Stash hook plugin that will automatically tag branches with a tag "archive/<branch name>" before deletion
Java
1
star
20

karma-bamboo-reporter

Karma reporter that integrates with Bamboo tests reports
JavaScript
1
star
21

node-not-bin

Invert the exit code of a process
JavaScript
1
star