From e6b23df180457705eeb20c81900e20042aa2338f Mon Sep 17 00:00:00 2001 From: rpm-mcarman <65228808+rpm-mcarman@users.noreply.github.com> Date: Thu, 26 Sep 2024 09:00:25 -0400 Subject: [PATCH] w/o token auth on api calls --- Sources/App/Controllers/UserController.swift | 8 ++++++++ Sources/App/Errors/UserErrors.swift | 8 ++++++++ Sources/App/Migrations/CreateToken.swift | 8 ++++++++ Sources/App/Migrations/CreateUser.swift | 8 ++++++++ Sources/App/Models/Token.swift | 8 ++++++++ Sources/App/Models/User.swift | 16 ++++++++++++++++ 6 files changed, 56 insertions(+) create mode 100644 Sources/App/Controllers/UserController.swift create mode 100644 Sources/App/Errors/UserErrors.swift create mode 100644 Sources/App/Migrations/CreateToken.swift create mode 100644 Sources/App/Migrations/CreateUser.swift create mode 100644 Sources/App/Models/Token.swift create mode 100644 Sources/App/Models/User.swift diff --git a/Sources/App/Controllers/UserController.swift b/Sources/App/Controllers/UserController.swift new file mode 100644 index 0000000..cc4702c --- /dev/null +++ b/Sources/App/Controllers/UserController.swift @@ -0,0 +1,8 @@ +// +// File.swift +// +// +// Created by Michiel Carman on 9/26/24. +// + +import Foundation diff --git a/Sources/App/Errors/UserErrors.swift b/Sources/App/Errors/UserErrors.swift new file mode 100644 index 0000000..cc4702c --- /dev/null +++ b/Sources/App/Errors/UserErrors.swift @@ -0,0 +1,8 @@ +// +// File.swift +// +// +// Created by Michiel Carman on 9/26/24. +// + +import Foundation diff --git a/Sources/App/Migrations/CreateToken.swift b/Sources/App/Migrations/CreateToken.swift new file mode 100644 index 0000000..cc4702c --- /dev/null +++ b/Sources/App/Migrations/CreateToken.swift @@ -0,0 +1,8 @@ +// +// File.swift +// +// +// Created by Michiel Carman on 9/26/24. +// + +import Foundation diff --git a/Sources/App/Migrations/CreateUser.swift b/Sources/App/Migrations/CreateUser.swift new file mode 100644 index 0000000..cc4702c --- /dev/null +++ b/Sources/App/Migrations/CreateUser.swift @@ -0,0 +1,8 @@ +// +// File.swift +// +// +// Created by Michiel Carman on 9/26/24. +// + +import Foundation diff --git a/Sources/App/Models/Token.swift b/Sources/App/Models/Token.swift new file mode 100644 index 0000000..b2a1ea5 --- /dev/null +++ b/Sources/App/Models/Token.swift @@ -0,0 +1,8 @@ +// +// File.swift +// +// +// Created by Michiel Carman on 9/24/24. +// + +import Foundation diff --git a/Sources/App/Models/User.swift b/Sources/App/Models/User.swift new file mode 100644 index 0000000..caa91d5 --- /dev/null +++ b/Sources/App/Models/User.swift @@ -0,0 +1,16 @@ +// +// File.swift +// +// +// Created by Michiel Carman on 9/24/24. +// + +import Foundation +import Vapor +import Fluent + +final class User: Model { + @ID var id: UUID? + + @Field(key: "name") var name: String +}