Skip to content

Commit f1b8829

Browse files
committed
minor fixes
1 parent 6b34ba4 commit f1b8829

File tree

5 files changed

+8
-76
lines changed

5 files changed

+8
-76
lines changed

Makefile

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
2-
3-
# ----------------------------------------
4-
# Swift
5-
# ----------------------------------------
6-
7-
start:
8-
swift run AVAllianceHummingbirdServer
9-
10-
11-
# docker build -t av-alliance-test-image -f Docker/BlogTests.Dockerfile .
12-
# docker run --name av-alliance-test-instance --rm av-alliance-test-image
13-
14-
run:
15-
swift run App
16-
171
build:
182
swift build
193

@@ -29,62 +13,5 @@ test-with-coverage:
2913
clean:
3014
rm -rf .build
3115

32-
# ----------------------------------------
33-
# System
34-
# ----------------------------------------
35-
36-
install: release
37-
install ./.build/release/App /usr/local/bin/App
38-
39-
uninstall:
40-
rm /usr/local/bin/App
41-
42-
# ----------------------------------------
43-
# Docker
44-
# ----------------------------------------
45-
46-
docker-build:
47-
docker build \
48-
-t av-alliance-image \
49-
-f ./docker/AVAlliance.Dockerfile \
50-
.
51-
52-
docker-run: docker-build
53-
docker run \
54-
--name av-alliance \
55-
-v $(PWD)/:/app \
56-
-w /app \
57-
-e "PS1=\u@\w: " \
58-
-p 8080:8080 \
59-
--rm \
60-
-it av-alliance-image
61-
62-
docker-clean:
63-
docker rmi av-alliance-image
64-
65-
# swift-format commands
66-
6716
format:
6817
swift-format -i -r ./Sources && swift-format -i -r ./Tests
69-
70-
lint:
71-
swift-format lint -r ./Sources && swift-format lint -r ./Tests
72-
73-
openapi-server:
74-
#docker run -p 8888:8080 -e SWAGGER_JSON=/mnt/openapi.yaml -v ./OpenAPI:/mnt swaggerapi/swagger-ui
75-
docker run --rm --name "openapi-server" \
76-
-v "$(PWD)/OpenAPI:/usr/share/nginx/html" \
77-
-p 8888:80 nginx
78-
79-
openapi-validate:
80-
docker run --rm --name "openapi-validate" \
81-
-v "$(PWD)/OpenAPI/openapi.yaml:/openapi.yaml" \
82-
pythonopenapi/openapi-spec-validator /openapi.yaml
83-
84-
openapi-security-check:
85-
docker run --rm --name "openapi-security-check" \
86-
-v "$(PWD)/OpenAPI:/app" \
87-
-t owasp/zap2docker-weekly zap-api-scan.py \
88-
-t /app/openapi.yaml -f openapi
89-
90-

Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ let package = Package(
2020
.target(name: "Bcrypt", dependencies: [
2121
.target(name: "CBcrypt"),
2222
]),
23-
// MARK: - tests
2423
.testTarget(
2524
name: "BcryptTests",
2625
dependencies: [

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@ import Bcrypt
2626
let digest = try Bcrypt.hash("binary-birds", cost: 6)
2727
let res = try Bcrypt.verify("binary-birds", created: digest)
2828
```
29+
30+
## Credits
31+
32+
This code is derived from the Vapor web framework:
33+
34+
- [Vapor](https://github.com/vapor/vapor)

Sources/Bcrypt/BCrypt.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import CBcrypt
2-
import Foundation
32

43
extension FixedWidthInteger {
54
public static func random() -> Self {
@@ -289,7 +288,7 @@ public final class BCryptDigest {
289288
}
290289
}
291290

292-
public enum BcryptError: Swift.Error, CustomStringConvertible, LocalizedError {
291+
public enum BcryptError: Swift.Error, CustomStringConvertible {
293292
case invalidCost
294293
case invalidSalt
295294
case hashFailure

Tests/BcryptTests/BcryptTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Bcrypt
22
import XCTest
33

44
final class BcryptTests: XCTestCase {
5+
56
func testVerify() throws {
67
for (desired, message) in tests {
78
let result = try Bcrypt.verify(message, created: desired)

0 commit comments

Comments
 (0)