Skip to content

Commit

Permalink
structure
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuawright11 committed Dec 8, 2024
1 parent cefcd17 commit 2a803de
Show file tree
Hide file tree
Showing 328 changed files with 166 additions and 1,467 deletions.
278 changes: 0 additions & 278 deletions Alchemy/Hashing/Providers/BCryptHasher.swift

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions Alchemy/Sources/Hashing/Providers/BCryptHasher.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import Foundation
import HummingbirdBcrypt

extension HashAlgorithm where Self == BCryptHasher {
public static var bcrypt: BCryptHasher {
BCryptHasher(rounds: 10)
}

public static func bcrypt(rounds: Int) -> BCryptHasher {
BCryptHasher(rounds: rounds)
}
}

public final class BCryptHasher: HashAlgorithm {
private let rounds: UInt8

public init(rounds: Int) {
self.rounds = UInt8(rounds)
}

public func verify(_ plaintext: String, hash: String) -> Bool {
Bcrypt.verify(plaintext, hash: hash)
}

public func make(_ value: String) -> String {
Bcrypt.hash(value, cost: rounds)
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import AlchemyTest
import AlchemyTesting

final class BasicAuthableTests: TestCase<TestApp> {
func testBasicAuthable() async throws {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import AlchemyTest
import AlchemyTesting

final class TokenAuthableTests: TestCase<TestApp> {
func testTokenAuthable() async throws {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import AlchemyTest
import XCTest
import AlchemyTesting

final class CacheTests: TestCase<TestApp> {
private lazy var allTests = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@testable
import Alchemy
import AlchemyTest
import AlchemyTesting

final class MakeCommandTests: TestCase<TestApp> {
var fileName: String = UUID().uuidString
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@testable
import Alchemy
import AlchemyTest
import AlchemyTesting

final class MigrateCommandTests: TestCase<TestApp> {
func testRun() async throws {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@testable
import Alchemy
import AlchemyTest
import Testing
import AlchemyTesting

final class SeedCommandTests: TestCase<TestApp> {
func testSeed() async throws {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@testable import Alchemy
import AlchemyTest
@testable
import Alchemy
import AlchemyTesting

final class MigrationTests: TestCase<TestApp> {
private let m1 = Migration1()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import MySQLNIO
@testable
import Alchemy
import AlchemyTest
import AlchemyTesting
import MySQLNIO
import NIOSSL

final class MySQLDatabaseTests: TestCase<TestApp> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@testable
import Alchemy
import AlchemyTest
import AlchemyTesting
import NIOSSL

final class PostgresDatabaseTests: TestCase<TestApp> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@testable
import Alchemy
import AlchemyTest
import AlchemyTesting
import SQLiteNIO

final class SQLiteDatabaseTests: TestCase<TestApp> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@testable
import Alchemy
import AlchemyTest
import AlchemyTesting

final class QueryGroupingTests: TestCase<TestApp> {
private let sampleWhere = SQLWhere.and(.value(column: "id", op: .equals, value: .value(.int(1))))
Expand Down
Loading

0 comments on commit 2a803de

Please sign in to comment.