Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tib committed Feb 8, 2024
1 parent 6b34ba4 commit f1b8829
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 76 deletions.
73 changes: 0 additions & 73 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@


# ----------------------------------------
# Swift
# ----------------------------------------

start:
swift run AVAllianceHummingbirdServer


# docker build -t av-alliance-test-image -f Docker/BlogTests.Dockerfile .
# docker run --name av-alliance-test-instance --rm av-alliance-test-image

run:
swift run App

build:
swift build

Expand All @@ -29,62 +13,5 @@ test-with-coverage:
clean:
rm -rf .build

# ----------------------------------------
# System
# ----------------------------------------

install: release
install ./.build/release/App /usr/local/bin/App

uninstall:
rm /usr/local/bin/App

# ----------------------------------------
# Docker
# ----------------------------------------

docker-build:
docker build \
-t av-alliance-image \
-f ./docker/AVAlliance.Dockerfile \
.

docker-run: docker-build
docker run \
--name av-alliance \
-v $(PWD)/:/app \
-w /app \
-e "PS1=\u@\w: " \
-p 8080:8080 \
--rm \
-it av-alliance-image

docker-clean:
docker rmi av-alliance-image

# swift-format commands

format:
swift-format -i -r ./Sources && swift-format -i -r ./Tests

lint:
swift-format lint -r ./Sources && swift-format lint -r ./Tests

openapi-server:
#docker run -p 8888:8080 -e SWAGGER_JSON=/mnt/openapi.yaml -v ./OpenAPI:/mnt swaggerapi/swagger-ui
docker run --rm --name "openapi-server" \
-v "$(PWD)/OpenAPI:/usr/share/nginx/html" \
-p 8888:80 nginx

openapi-validate:
docker run --rm --name "openapi-validate" \
-v "$(PWD)/OpenAPI/openapi.yaml:/openapi.yaml" \
pythonopenapi/openapi-spec-validator /openapi.yaml

openapi-security-check:
docker run --rm --name "openapi-security-check" \
-v "$(PWD)/OpenAPI:/app" \
-t owasp/zap2docker-weekly zap-api-scan.py \
-t /app/openapi.yaml -f openapi


1 change: 0 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ let package = Package(
.target(name: "Bcrypt", dependencies: [
.target(name: "CBcrypt"),
]),
// MARK: - tests
.testTarget(
name: "BcryptTests",
dependencies: [
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ import Bcrypt
let digest = try Bcrypt.hash("binary-birds", cost: 6)
let res = try Bcrypt.verify("binary-birds", created: digest)
```

## Credits

This code is derived from the Vapor web framework:

- [Vapor](https://github.com/vapor/vapor)
3 changes: 1 addition & 2 deletions Sources/Bcrypt/BCrypt.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import CBcrypt
import Foundation

extension FixedWidthInteger {
public static func random() -> Self {
Expand Down Expand Up @@ -289,7 +288,7 @@ public final class BCryptDigest {
}
}

public enum BcryptError: Swift.Error, CustomStringConvertible, LocalizedError {
public enum BcryptError: Swift.Error, CustomStringConvertible {
case invalidCost
case invalidSalt
case hashFailure
Expand Down
1 change: 1 addition & 0 deletions Tests/BcryptTests/BcryptTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Bcrypt
import XCTest

final class BcryptTests: XCTestCase {

func testVerify() throws {
for (desired, message) in tests {
let result = try Bcrypt.verify(message, created: desired)
Expand Down

0 comments on commit f1b8829

Please sign in to comment.