Giter VIP home page Giter VIP logo

simplekeychain's Introduction

SimpleKeychain

Version CircleCI Coverage Status License

📚 Documentation • 🚀 Getting Started • 📃 Support Policy • 💬 Feedback

Migrating from 0.x? Check the Migration Guide.

Documentation

Getting Started

Requirements

  • iOS 12.0+ / macOS 10.15+ / tvOS 12.0+ / watchOS 6.2+
  • Xcode 13.x / 14.x
  • Swift 5.x

Note Check the Support Policy to learn when dropping Xcode, Swift, and platform versions will not be considered a breaking change.

Installation

Swift Package Manager

Open the following menu item in Xcode:

File > Add Packages...

In the Search or Enter Package URL search box enter this URL:

https://github.com/auth0/SimpleKeychain

Then, select the dependency rule and press Add Package.

Cocoapods

Add the following line to your Podfile:

pod 'SimpleKeychain', '~> 1.0'

Then, run pod install.

Carthage

Add the following line to your Cartfile:

github "auth0/SimpleKeychain" ~> 1.0

Then, run carthage bootstrap --use-xcframeworks.

Usage

Learn about more advanced features in Examples ↗

See all the available features in the API documentation ↗

let simpleKeychain = SimpleKeychain()

You can specify a service name under which to save items. By default the bundle identifier of your app is used.

let simpleKeychain = SimpleKeychain(service: "Auth0")

Store a string or data item

try simpleKeychain.set(accessToken, forKey: "auth0-access-token")

Check if an item is stored

let isStored = try simpleKeychain.hasItem(forKey: "auth0-access-token")

Retrieve a string item

let accessToken = try simpleKeychain.string(forKey: "auth0-access-token")

Retrieve a data item

let accessToken = try simpleKeychain.data(forKey: "auth0-credentials")

Retrieve the keys of all stored items

let keys = try simpleKeychain.keys()

Remove an item

try simpleKeychain.deleteItem(forKey: "auth0-access-token")

Remove all items

try simpleKeychain.deleteAll()

Error handling

All methods will throw a SimpleKeychainError upon failure.

catch let error as SimpleKeychainError {
    print(error)
}

Support Policy

This Policy defines the extent of the support for Xcode, Swift, and platform (iOS, macOS, tvOS, and watchOS) versions in SimpleKeychain.

Xcode

The only supported versions of Xcode are those that can be currently used to submit apps to the App Store. Once a Xcode version becomes unsupported, dropping it from SimpleKeychain will not be considered a breaking change, and will be done in a minor release.

Swift

The minimum supported Swift minor version is the one released with the oldest-supported Xcode version. Once a Swift minor becomes unsupported, dropping it from SimpleKeychain will not be considered a breaking change, and will be done in a minor release.

Platforms

Only the last 4 major platform versions are supported, starting from:

  • iOS 12
  • macOS 10.15
  • macCatalyst 13
  • tvOS 12
  • watchOS 6.2

Once a platform version becomes unsupported, dropping it from SimpleKeychain will not be considered a breaking change, and will be done in a minor release. For example, iOS 13 will cease to be supported when iOS 17 gets released, and SimpleKeychain will be able to drop it in a minor release.

In the case of macOS, the yearly named releases are considered a major platform version for the purposes of this Policy, regardless of the actual version numbers.

Feedback

Contributing

We appreciate feedback and contribution to this repo! Before you get started, please see the following:

Raise an issue

To provide feedback or report a bug, please raise an issue on our issue tracker.

Vulnerability reporting

Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.


Auth0 Logo

Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout Why Auth0?

This project is licensed under the MIT license. See the LICENSE file for more info.

simplekeychain's People

Contributors

adamjmcgrath avatar asclepix avatar cocojoe avatar cysp avatar damieng avatar davidjb avatar eaceto avatar elkraneo avatar evansims avatar fossabot avatar hzalaz avatar janakmshah avatar joshcanhelp avatar jstart avatar lbalmaceda avatar mathieutozer avatar mgonto avatar nsarno avatar pose avatar snyk-bot avatar sre-57-opslevel[bot] avatar stuclift avatar widcket avatar woloski avatar yanniks avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.