openapi: 3.0.3
info:
  title: SifreleNet Developer API
  version: 1.0.0
  description: CVE, Short Links ve Hash servisleri için ürün başına API anahtarı modeli.
servers:
  - url: https://dev.sifrele.net/api/v1
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /cve:
    get:
      summary: CVE listesi
      tags: [CVE]
      responses:
        '200':
          description: Yayınlanmış CVE kayıtları
        '401':
          description: Geçersiz veya eksik API anahtarı
  /cve/{id}:
    get:
      summary: CVE detayı
      tags: [CVE]
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: CVE detayı
        '404':
          description: Bulunamadı
  /short-links:
    post:
      summary: Kısa link oluştur
      tags: [Short Links]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [original_url]
              properties:
                original_url:
                  type: string
                  format: uri
                slug:
                  type: string
      responses:
        '201':
          description: Oluşturuldu
  /short-links/{slug}:
    get:
      summary: Kısa link çözümle
      tags: [Short Links]
      parameters:
        - in: path
          name: slug
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Link bilgisi
  /hash/lookup:
    post:
      summary: Hash hesapla / doğrula
      tags: [Hash]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [algorithm, value]
              properties:
                algorithm:
                  type: string
                  enum: [md5, sha1, sha256]
                value:
                  type: string
                  maxLength: 8192
                expected_hash:
                  type: string
      responses:
        '200':
          description: Hash sonucu
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
