{"id":29434357,"url":"https://github.com/brunogama/swiftlivenesskit","last_synced_at":"2025-10-08T07:15:34.456Z","repository":{"id":304142458,"uuid":"1017373703","full_name":"brunogama/SwiftLivenessKit","owner":"brunogama","description":"Production-ready iOS liveness detection with multi-vendor support, automatic fallback, and enterprise security. Built with Swift 6 actors and async/await.","archived":false,"fork":false,"pushed_at":"2025-07-10T15:22:15.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-17T21:54:44.164Z","etag":null,"topics":["actors","app-attest","async-await","biometric-authentication","certificate-pinning","enterprise","face-recognition","fallback-strategy","ios","liveness-detection","mobile-security","multi-vendor","security","swift","swift-concurrency"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brunogama.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-10T12:41:17.000Z","updated_at":"2025-07-10T15:22:18.000Z","dependencies_parsed_at":"2025-07-11T12:47:09.608Z","dependency_job_id":null,"html_url":"https://github.com/brunogama/SwiftLivenessKit","commit_stats":null,"previous_names":["brunogama/swiftlivenesskit"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/brunogama/SwiftLivenessKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunogama%2FSwiftLivenessKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunogama%2FSwiftLivenessKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunogama%2FSwiftLivenessKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunogama%2FSwiftLivenessKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brunogama","download_url":"https://codeload.github.com/brunogama/SwiftLivenessKit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunogama%2FSwiftLivenessKit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278904437,"owners_count":26066070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actors","app-attest","async-await","biometric-authentication","certificate-pinning","enterprise","face-recognition","fallback-strategy","ios","liveness-detection","mobile-security","multi-vendor","security","swift","swift-concurrency"],"created_at":"2025-07-13T02:12:18.248Z","updated_at":"2025-10-08T07:15:34.452Z","avatar_url":"https://github.com/brunogama.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftLivenessKit\n\nA production-ready, multi-vendor liveness detection system built with Swift 6's strict concurrency, featuring automatic vendor fallback, comprehensive security, and reactive event streams.\n\n## Features\n\n✅ **Clean Architecture** - Single source of truth with no code duplication  \n✅ **Multi-Vendor Support** - Automatic fallback between liveness detection vendors  \n✅ **Swift 6 Concurrency** - Actor-based design with strict concurrency safety  \n✅ **Reactive Events** - AsyncThrowingStream for real-time progress updates  \n✅ **Type Safety** - Comprehensive error handling and strongly-typed configurations  \n✅ **Memory Safe** - Weak references and automatic cleanup  \n✅ **iOS 14+ Support** - Compatible with modern iOS deployment targets  \n\n## Project Structure\n\n```\nSwiftLivenessKit/\n├── Package.swift                 # Swift Package Manager configuration\n├── Sources/\n│   └── LivenessDetection/       # Main library module\n│       ├── Core/\n│       │   ├── Types/           # Core data types (Result, Error, Event, Configuration)\n│       │   ├── Protocols/       # Main protocol definitions\n│       │   ├── Base/            # Base implementations\n│       │   └── Composite/       # Composite adapter for vendor management\n│       ├── Adapters/\n│       │   ├── VendorA/         # VendorA implementation\n│       │   ├── VendorB/         # VendorB implementation\n│       │   └── Mock/            # Mock adapter for testing\n│       ├── Security/            # Security features\n│       └── Factory/             # Adapter factory\n└── Tests/\n    └── LivenessDetectionTests/  # Unit tests\n```\n\n## Installation\n\n### Swift Package Manager\n\nAdd the following to your `Package.swift` file:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/yourusername/SwiftLivenessKit.git\", from: \"1.0.1\")\n]\n```\n\nOr in Xcode:\n1. Go to File → Add Package Dependencies\n2. Enter the repository URL\n3. Select version 1.0.1 or later\n\n## Quick Start\n\n```swift\nimport LivenessDetection\n\n// Configure vendors\nlet vendorConfigs: [any LivenessConfiguration] = [\n    VendorAConfiguration(apiKey: \"your-api-key\"),\n    VendorBConfiguration(clientId: \"your-client-id\", clientSecret: \"your-client-secret\"),\n    MockConfiguration(shouldSucceed: true) // For testing\n]\n\n// Create adapter factory and environment\nlet factory = DefaultAdapterFactory()\nlet environment = LivenessEnvironment(\n    adapterFactory: factory,\n    logger: { print(\"LivenessKit: \\($0)\") }\n)\n\n// Create composite adapter\nlet adapter = CompositeLivenessAdapter(\n    environment: environment,\n    vendorConfigurations: vendorConfigs\n)\n\n// Perform liveness detection\nlet eventStream = adapter.startLivenessDetection(in: viewController)\n\nfor try await event in eventStream {\n    switch event {\n    case .started:\n        print(\"Liveness detection started\")\n    case .progress(let percentage):\n        print(\"Progress: \\(percentage * 100)%\")\n    case .instructionChanged(let instruction):\n        print(\"Instruction: \\(instruction)\")\n    case .completed(let result):\n        print(\"Success! Confidence: \\(result.confidence)\")\n        break\n    case .failed(let error):\n        print(\"Error: \\(error.localizedDescription)\")\n        break\n    }\n}\n```\n\n## Architecture\n\n### Core Components\n\n- **LivenessVendorAdapter** - Protocol for vendor-specific implementations\n- **CompositeLivenessAdapter** - Manages multiple vendors with automatic fallback\n- **LivenessConfiguration** - Type-safe configuration for each vendor\n- **LivenessEvent** - Reactive event system for progress tracking\n- **LivenessError** - Comprehensive error handling\n\n### Vendor Support\n\nThe framework supports multiple liveness detection vendors:\n\n- **VendorA** - Fast detection with basic progress tracking\n- **VendorB** - Detailed metadata and comprehensive progress steps\n- **Mock** - For testing and development\n\n### Event System\n\n```swift\npublic enum LivenessEvent {\n    case started\n    case progress(percentage: Double)\n    case instructionChanged(String)\n    case completed(LivenessResult)\n    case failed(LivenessError)\n}\n```\n\n### Error Handling\n\n```swift\npublic enum LivenessError: Error {\n    case configurationFailed(reason: String)\n    case timeout(vendor: String)\n    case vendorSpecific(vendor: String, code: Int, message: String)\n    case noAvailableVendor\n    case cancelled\n    case invalidState(String)\n    case viewControllerDeallocated\n}\n```\n\n## Requirements\n\n- iOS 14.0+\n- Swift 5.9+\n- Xcode 15.0+\n\n## Version History\n\n- **1.0.1** - Major refactoring and cleanup (2025-01-10)\n- **1.0.0** - Initial release (2024-01-10)\n\n## License\n\nMIT License - see LICENSE file for details.\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## Support\n\nFor issues and questions, please open an issue on GitHub or contact the maintainers.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunogama%2Fswiftlivenesskit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrunogama%2Fswiftlivenesskit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunogama%2Fswiftlivenesskit/lists"}