Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add user login related attempts to ParseCloudUser #51

Merged
merged 4 commits into from
Jan 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ deprecation warnings when building your app in Xcode before upgrading
to [Corey Baker](https://github.com/cbaker6).

__New features__
* Add user login related attempts to ParseCloudUser. This allows developers to decode login related information when using Parse-Swift for Cloud Code ([#51](https://github.com/netreconlab/Parse-Swift/pull/51)), thanks to [Corey Baker](https://github.com/cbaker6).
* Add option to set the serverURL for a particular call. This is useful when using the Swift SDK for Cloud Code in a multi-server environment ([#50](https://github.com/netreconlab/Parse-Swift/pull/50)), thanks to [Corey Baker](https://github.com/cbaker6).
* ParseVersion now supports pre-release versions of the SDK ([#49](https://github.com/netreconlab/Parse-Swift/pull/49)), thanks to [Corey Baker](https://github.com/cbaker6).
* Adds the the ability to watch particular keys with LiveQueries. Requires Parse-Server 6.0.0 ([#48](https://github.com/netreconlab/Parse-Swift/pull/48)), thanks to [Corey Baker](https://github.com/cbaker6).
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@

---

[![Playgrounds](http://img.shields.io/badge/swift-playgrounds-2196f3.svg)](https://github.com/netreconlab/Parse-Swift/tree/main/ParseSwift.playground/Pages)
[![Documentation](http://img.shields.io/badge/read_-docs-2196f3.svg)](https://swiftpackageindex.com/netreconlab/Parse-Swift/documentation)
[![Tuturiol](http://img.shields.io/badge/read_-tuturials-2196f3.svg)](https://netreconlab.github.io/Parse-Swift/release/tutorials/parseswift/)
[![Build Status CI](https://github.com/netreconlab/Parse-Swift/workflows/ci/badge.svg?branch=main)](https://github.com/netreconlab/Parse-Swift/actions?query=workflow%3Aci+branch%3Amain)
[![Build Status Release](https://github.com/netreconlab/Parse-Swift/workflows/release/badge.svg)](https://github.com/netreconlab/Parse-Swift/actions?query=workflow%3Arelease)
[![Coverage](https://codecov.io/gh/netreconlab/Parse-Swift/branch/main/graph/badge.svg)](https://codecov.io/gh/netreconlab/Parse-Swift/branches)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/403b74d0f2514e288b0a1b2e52b6d841)](https://www.codacy.com/gh/netreconlab/Parse-Swift/dashboard?utm_source=github.com&utm_medium=referral&utm_content=netreconlab/Parse-Swift&utm_campaign=Badge_Grade)
[![Carthage](https://img.shields.io/badge/carthage-compatible-4BC51D.svg?style=flat)](https://github.com/carthage/carthage)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)][license-link]

[![Swift Versions](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fnetreconlab%2FParse-Swift%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/netreconlab/Parse-Swift)
[![Platforms](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fnetreconlab%2FParse-Swift%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/netreconlab/Parse-Swift)

Expand Down
5 changes: 5 additions & 0 deletions Sources/ParseSwift/Objects/ParseCloudUser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@ import Foundation
public protocol ParseCloudUser: ParseUser {
/// The session token of the `ParseUser`.
var sessionToken: String? { get set }
/// The number of unsuccessful login attempts.
var _failed_login_count: Int? { get }

Check warning

Code scanning / Tailor (reported by Codacy)

Variable names should be lowerCamelCase

Variable names should be lowerCamelCase
/// The date the lockout expires. After this date, the `ParseUser`
/// can attempt to login again.
var _account_lockout_expires_at: Date? { get }

Check warning

Code scanning / Tailor (reported by Codacy)

Variable names should be lowerCamelCase

Variable names should be lowerCamelCase
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ class ParseHookFunctionRequestCombineTests: XCTestCase {
var emailVerified: Bool?
var password: String?
var authData: [String: [String: String]?]?

// These are required by ParseCloudUser
var sessionToken: String?
var _failed_login_count: Int?
var _account_lockout_expires_at: Date?

// Your custom keys
var customKey: String?
Expand Down
4 changes: 4 additions & 0 deletions Tests/ParseSwiftTests/ParseHookFunctionRequestTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ class ParseHookFunctionRequestTests: XCTestCase {
var emailVerified: Bool?
var password: String?
var authData: [String: [String: String]?]?

// These are required by ParseCloudUser
var sessionToken: String?
var _failed_login_count: Int?
var _account_lockout_expires_at: Date?

// Your custom keys
var customKey: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class ParseHookTriggerRequestCombineTests: XCTestCase {
var emailVerified: Bool?
var password: String?
var authData: [String: [String: String]?]?

// These are required by ParseCloudUser
var sessionToken: String?
var _failed_login_count: Int?
var _account_lockout_expires_at: Date?

// Your custom keys
var customKey: String?
Expand Down
4 changes: 4 additions & 0 deletions Tests/ParseSwiftTests/ParseHookTriggerRequestTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ class ParseHookTriggerRequestTests: XCTestCase {
var emailVerified: Bool?
var password: String?
var authData: [String: [String: String]?]?

// These are required by ParseCloudUser
var sessionToken: String?
var _failed_login_count: Int?
var _account_lockout_expires_at: Date?

// Your custom keys
var customKey: String?
Expand Down