@@ -11,9 +11,9 @@ import { RunEnvironment, runEnvironments } from "../common/roles.js";
1111import { InternalServerError } from "../common/errors/index.js" ;
1212import eventsPlugin from "./routes/events.js" ;
1313import cors from "@fastify/cors" ;
14- import fastifyZodValidationPlugin from "./plugins/validate.js" ;
1514import { environmentConfig , genericConfig } from "../common/config.js" ;
1615import organizationsPlugin from "./routes/organizations.js" ;
16+ import authorizeFromSchemaPlugin from "./plugins/authorizeFromSchema.js" ;
1717import icalPlugin from "./routes/ics.js" ;
1818import vendingPlugin from "./routes/vending.js" ;
1919import * as dotenv from "dotenv" ;
@@ -93,15 +93,18 @@ async function init(prettyPrint: boolean = false) {
9393 return event . requestContext . requestId ;
9494 } ,
9595 } ) ;
96+ app . setValidatorCompiler ( validatorCompiler ) ;
97+ app . setSerializerCompiler ( serializerCompiler ) ;
98+ await app . register ( authorizeFromSchemaPlugin ) ;
9699 await app . register ( fastifyAuthPlugin ) ;
97- await app . register ( fastifyZodValidationPlugin ) ;
98100 await app . register ( FastifyAuthProvider ) ;
99101 await app . register ( errorHandlerPlugin ) ;
100102 await app . register ( fastifyZodOpenApiPlugin ) ;
101103 await app . register ( fastifySwagger , {
102104 openapi : {
103105 info : {
104106 title : "ACM @ UIUC Core API" ,
107+ description : "ACM @ UIUC Core Management Platform" ,
105108 version : "1.0.0" ,
106109 } ,
107110 servers : [
@@ -119,11 +122,11 @@ async function init(prettyPrint: boolean = false) {
119122 {
120123 name : "Events" ,
121124 description :
122- "Retrieve ACM-wide and organization-specific calendars and event metadata." ,
125+ "Retrieve ACM @ UIUC -wide and organization-specific calendars and event metadata." ,
123126 } ,
124127 {
125128 name : "Generic" ,
126- description : "Retrieve metadata about a user or ACM." ,
129+ description : "Retrieve metadata about a user or ACM @ UIUC ." ,
127130 } ,
128131 {
129132 name : "iCalendar Integration" ,
@@ -139,6 +142,10 @@ async function init(prettyPrint: boolean = false) {
139142 name : "Logging" ,
140143 description : "View audit logs for various services." ,
141144 } ,
145+ {
146+ name : "Membership" ,
147+ description : "Purchasing or checking ACM @ UIUC membership." ,
148+ } ,
142149 ] ,
143150 openapi : "3.0.3" satisfies ZodOpenApiVersion , // If this is not specified, it will default to 3.1.0
144151 } ,
0 commit comments