{"openapi":"3.0.3","info":{"title":"Dark Solar Tactical Gaming OAuth API","version":"1.0.0","description":"Sign in with DSTG and read a member's public profile. Register an app in the developer portal before calling the authorize endpoint."},"servers":[{"url":"https://www.darksolargaming.com"}],"tags":[{"name":"oauth","description":"Authorization code, token, and revoke"},{"name":"identity","description":"Bearer-token member profile"},{"name":"public","description":"Public Armory profile"}],"paths":{"/oauth/authorize":{"get":{"tags":["oauth"],"summary":"Start Sign in with DSTG","parameters":[{"name":"response_type","in":"query","required":true,"schema":{"type":"string","enum":["code"]}},{"name":"client_id","in":"query","required":true,"schema":{"type":"string"}},{"name":"redirect_uri","in":"query","required":true,"schema":{"type":"string","format":"uri"}},{"name":"state","in":"query","required":true,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","example":"openid profile"}},{"name":"code_challenge","in":"query","required":false,"schema":{"type":"string"}},{"name":"code_challenge_method","in":"query","required":false,"schema":{"type":"string","enum":["S256"]}}],"responses":{"302":{"description":"Consent screen, or redirect back with code or error."}}}},"/api/oauth/token":{"post":{"tags":["oauth"],"summary":"Exchange an authorization code or refresh a token","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}}},"responses":{"200":{"description":"Token response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"400":{"description":"OAuth error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}}}}},"/api/oauth/revoke":{"post":{"tags":["oauth"],"summary":"Revoke an access or refresh token","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["token","client_id"],"properties":{"token":{"type":"string"},"client_id":{"type":"string"},"client_secret":{"type":"string"}}}}}},"responses":{"200":{"description":"Revoked, or already unknown."}}}},"/api/oauth/userinfo":{"get":{"tags":["identity"],"summary":"Member profile for the bearer token","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Scoped profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfo"}}}},"401":{"description":"Missing or expired token"}}}},"/api/v1/me":{"get":{"tags":["identity"],"summary":"Alias of /api/oauth/userinfo","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Scoped profile"}}}},"/api/v1/operators/{slug}":{"get":{"tags":["public"],"summary":"Public Armory profile","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Public profile"},"404":{"description":"No Armory with that slug"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"TokenRequest":{"type":"object","required":["grant_type","client_id"],"properties":{"grant_type":{"type":"string","enum":["authorization_code","refresh_token"]},"code":{"type":"string"},"redirect_uri":{"type":"string"},"client_id":{"type":"string"},"client_secret":{"type":"string"},"code_verifier":{"type":"string"},"refresh_token":{"type":"string"}}},"TokenResponse":{"type":"object","properties":{"access_token":{"type":"string"},"refresh_token":{"type":"string"},"token_type":{"type":"string","example":"Bearer"},"expires_in":{"type":"integer","example":3600},"scope":{"type":"string"}}},"UserInfo":{"type":"object","properties":{"sub":{"type":"string"},"name":{"type":"string","nullable":true},"picture":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"email_verified":{"type":"boolean"},"rank":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}}},"level":{"type":"string"},"military_tier":{"type":"string"},"is_team_dstg":{"type":"boolean"},"armory_url":{"type":"string","nullable":true},"profile_url":{"type":"string"}}},"OAuthError":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}}}}}}