Skip to content

Commit

Permalink
First commit to public repo
Browse files Browse the repository at this point in the history
  • Loading branch information
macblazer committed Sep 13, 2023
0 parents commit 840fd56
Show file tree
Hide file tree
Showing 88 changed files with 8,190 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-License-Identifier: MIT
# Copyright 2023, Jamf

* @macblazer @JacobHearst @jamf/apple-natives-write
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-License-Identifier: MIT
# Copyright 2023, Jamf

# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "swift"
directory: "/"
schedule:
interval: "weekly"
39 changes: 39 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# SPDX-License-Identifier: MIT
# Copyright 2023, Jamf

name: UnitTests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
Test-on-macOS:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- name: Run macOS tests (including integration)
run: swift test

Test-on-all-others:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- name: Run iOS tests
run: xcodebuild test -scheme Haversack-Package -destination 'platform=iOS Simulator,name=iPhone 14'
- name: Run tvOS tests
run: xcodebuild test -scheme Haversack-Package -destination 'platform=tvOS Simulator,name=Apple TV 4K (3rd generation)'
- name: Run watchOS tests
run: xcodebuild test -scheme Haversack-Package -destination 'platform=watchOS Simulator,name=Apple Watch Series 8 (41mm)'

SwiftLint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: GitHub Action for SwiftLint
uses: norio-nomura/[email protected]
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
.scannerwork/
build/
36 changes: 36 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
included:
- Sources
- Package.swift

line_length: 200
file_length:
warning: 500
ignore_comment_only_lines: true
type_body_length: 300

file_header:
severity: error
required_pattern: |
\/\/ SPDX-License-Identifier: MIT
\/\/ Copyright 2023, Jamf
opt_in_rules:
- contains_over_filter_count
- contains_over_filter_is_empty
- contains_over_first_not_nil
- contains_over_range_nil_comparison
- discouraged_direct_init
- discouraged_object_literal
- empty_collection_literal
- empty_count
- empty_string
- first_where
- flatmap_over_map_reduce
- last_where
- strict_fileprivate
- test_case_accessibility
- file_header

analyzer_rules:
- unused_declaration
- unused_import
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>FILEHEADER</key>
<string> SPDX-License-Identifier: MIT
// Copyright 2023, Jamf</string>
</dict>
</plist>

35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] - 2023-09-14
### Added
- Import and export capability for certificates, keys, and identities.
- Additional documentation and examples.

### Changed
- First public release.

## [1.0.0] - 2022-10-25 - internal Jamf release
### Added
- Async-await variants of all public functions that have completion handlers.

### Changed
- Queries now default to returning `.data` if not otherwise specified.
- The result of the `save()` function and it's async-await counterpart are marked as discardable. The function returns the item that was given to it to save which is sometimes handy, but not necessary.

### Fixed
- Search queries that ask for password data for multiple password entities (generic or internet) now fail with a clear error message explaining the problem.
- On iOS, fixed the `delete` function and the `save(..., updateExisting: true)` function (that calls `delete` behind the scenes).
- When calling `save` with the `updateExisting:` parameter set to true, the code does not throw an `errSecDuplicatedItem` if the item being saved only has very basic information such as a `SecCertificate`.

## [0.0.2] - 2021-11-03 - internal Jamf release
### Added
- Cryptographic key generation with a fluent interface in `KeyGenerationConfig`.
- GitHub Actions are used to run unit tests on macOS, iOS, tvOS, and watchOS, and integration tests on macOS during Pull Requests.

## [0.0.1] - 2021-09-08 - internal Jamf release
### Added
- Initial internal Jamf release.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright 2023, Jamf

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
32 changes: 32 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"pins" : [
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections",
"state" : {
"revision" : "937e904258d22af6e447a0b72c0bc67583ef64a2",
"version" : "1.0.4"
}
},
{
"identity" : "swift-docc-plugin",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-docc-plugin",
"state" : {
"revision" : "26ac5758409154cc448d7ab82389c520fa8a8247",
"version" : "1.3.0"
}
},
{
"identity" : "swift-docc-symbolkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-docc-symbolkit",
"state" : {
"revision" : "b45d1f2ed151d057b54504d653e0da5552844e34",
"version" : "1.0.0"
}
}
],
"version" : 2
}
32 changes: 32 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// swift-tools-version:5.6
// SPDX-License-Identifier: MIT
// Copyright 2023, Jamf

import PackageDescription

let package = Package(
name: "Haversack",
platforms: [
.macOS(.v10_13),
.iOS(.v12),
.tvOS(.v12),
.watchOS(.v5)
],
products: [
.library(name: "Haversack", targets: ["Haversack"]),
.library(name: "HaversackCryptoKit", targets: ["HaversackCryptoKit"]),
.library(name: "HaversackMock", targets: ["HaversackMock"])
],
dependencies: [
.package(url: "https://github.com/apple/swift-collections", from: "1.0.4"),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.2.0")
],
targets: [
.target(name: "Haversack", dependencies: [
.product(name: "OrderedCollections", package: "swift-collections")]),
.target(name: "HaversackCryptoKit", dependencies: ["Haversack"]),
.target(name: "HaversackMock", dependencies: ["Haversack"]),
.testTarget(name: "HaversackTests", dependencies: ["HaversackMock"],
resources: [.copy("TestResources/")])
]
)
14 changes: 14 additions & 0 deletions PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>
Loading

0 comments on commit 840fd56

Please sign in to comment.