Changeset 462


Ignore:
Timestamp:
Aug 14, 2023, 9:16:51 PM (16 months ago)
Author:
alloc
Message:

More OpenAPI specs added

Location:
TFP-WebServer/WebServer
Files:
7 added
5 edited

Legend:

Unmodified
Added
Removed
  • TFP-WebServer/WebServer/WebServer.csproj

    r460 r462  
    203203    <EmbeddedResource Include="src\WebAPI\APIs\Command.openapi.yaml" />
    204204    <EmbeddedResource Include="src\WebAPI\APIs\Permissions\Blacklist.openapi.yaml" />
     205    <EmbeddedResource Include="src\WebAPI\APIs\Permissions\CommandPermissions.openapi.yaml" />
     206    <EmbeddedResource Include="src\WebAPI\APIs\Permissions\RegisterUser.openapi.yaml" />
     207    <EmbeddedResource Include="src\WebAPI\APIs\Permissions\UserPermissions.openapi.yaml" />
     208    <EmbeddedResource Include="src\WebAPI\APIs\Permissions\WebApiTokens.openapi.yaml" />
     209    <EmbeddedResource Include="src\WebAPI\APIs\Permissions\WebModules.openapi.yaml" />
     210    <EmbeddedResource Include="src\WebAPI\APIs\Permissions\WebUsers.openapi.yaml" />
     211    <EmbeddedResource Include="src\WebAPI\APIs\Permissions\Whitelist.openapi.yaml" />
    205212    <EmbeddedResource Include="src\WebAPI\APIs\WorldState\Animal.openapi.yaml" />
    206213    <EmbeddedResource Include="src\WebAPI\OpenAPI.master.yaml" />
  • TFP-WebServer/WebServer/src/OpenID.cs

    r402 r462  
    2424                        new X509Certificate2 ($"{Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location)}/steam-intermediate.cer");
    2525
    26                 private const bool verboseSsl = false;
     26                private static bool verboseSsl = false;
    2727                public static bool debugOpenId;
    2828
  • TFP-WebServer/WebServer/src/WebAPI/APIs/Command.openapi.yaml

    r460 r462  
    8888      description: Simple style command result
    8989
     90    CommandExecutedResponse:
     91      type: object
     92      properties:
     93        data:
     94          oneOf:
     95            - $ref: '#/components/schemas/CommandExecutedResultFull'
     96            - $ref: '#/components/schemas/CommandExecutedResultSimple'
     97        meta:
     98          $ref: './openapi.yaml#/components/schemas/ResultEnvelopeMeta'
     99      required:
     100        - data
     101        - meta
    90102
    91103  requestBodies:
     
    167179            application/json:
    168180              schema:
    169                 oneOf:
    170                   - $ref: '#/components/schemas/CommandExecutedResultFull'
    171                   - $ref: '#/components/schemas/CommandExecutedResultSimple'
     181                $ref: '#/components/schemas/CommandExecutedResponse'
    172182            text/plain:
    173183              schema:
  • TFP-WebServer/WebServer/src/WebAPI/APIs/Permissions/Blacklist.openapi.yaml

    r460 r462  
    4242            type: object
    4343            properties:
    44               x:
    45                 type: integer
     44              bannedUntil:
     45                type: string
     46                format: date-time
     47              banReason:
     48                type: string
    4649                examples:
    47                   - -43
    48               y:
    49                 type: integer
     50                  - Cheating not allowed!
     51              name:
     52                type: string
    5053                examples:
    51                   - 842
    52               icon:
    53                 type: string
    54                 format: uuid
    55                 examples:
    56                   - https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Blue_question_mark_icon.svg/1200px-Blue_question_mark_icon.svg.png
     54                  - TheFunPimp
    5755            required:
    58               - x
    59               - y
     56              - bannedUntil
    6057      required: true
    61 
    62 
    63   parameters:
    64     UserIdPathParameter:
    65       name: id
    66       in: path
    67       required: true
    68       schema:
    69         $ref: '#/components/schemas/TypeUserIdString'
    7058
    7159
     
    8068      responses:
    8169        200:
    82           description: List of found markers
     70          description: List of blacklist entries
    8371          content:
    8472            application/json:
     
    9381                  - data
    9482                  - meta
     83        403:
     84          $ref: './openapi.yaml#/components/responses/Unauthorized'
     85      security:
     86        - apiTokenName: [ ]
     87          apiTokenSecret: [ ]
     88        - sessionCookie: [ ]
    9589
    9690
     
    119113      operationId: blacklist.post.id
    120114      parameters:
    121         - $ref: '#/components/parameters/UserIdPathParameter'
     115        - $ref: './openapi.yaml#/components/parameters/UserIdPathParameter'
    122116      requestBody:
    123117        $ref: '#/components/requestBodies/BlacklistBodyIn'
    124118      responses:
    125119        201:
    126           description: Marker with updated values
     120          description: Blacklist entry created or updated
    127121          $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
    128122        400:
    129           description: >-
    130             Invalid request body, errorCode will be one of 'NO_OR_INVALID_X',
    131             'NO_OR_INVALID_Y'
     123          description: Invalid request body, errorCode will be 'NO_OR_INVALID_BANNED_UNTIL'
    132124          $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
    133125        403:
     
    145137      operationId: blacklist.delete.id
    146138      parameters:
    147         - $ref: '#/components/parameters/UserIdPathParameter'
     139        - $ref: './openapi.yaml#/components/parameters/UserIdPathParameter'
    148140      responses:
    149141        204:
    150           description: Deleted marker
     142          description: Deleted blacklist entry
    151143          $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
    152144        404:
    153           description: Marker ID not found
     145          description: User ID not found
    154146          $ref: './openapi.yaml#/components/responses/HttpEmptyEnvelopedResponse'
    155147        403:
  • TFP-WebServer/WebServer/src/WebAPI/OpenAPI.master.yaml

    r460 r462  
    113113
    114114
     115  parameters:
     116    UserIdPathParameter:
     117      name: id
     118      in: path
     119      required: true
     120      schema:
     121        $ref: '#/components/schemas/TypeUserIdString'
     122
     123
    115124  responses:
    116125    HttpEmptyEnvelopedResponse:
Note: See TracChangeset for help on using the changeset viewer.