{
  "title": "Auth",
  "description": "JSON schema for ZOAuth description collections",
	"$schema": "http://json-schema.org/draft-04/schema#",
	"type": "object",
  "definitions": {
    "Id": {
      "type": "string"
    },
    "DateTime": {
      "type": "string"
    },
    "Link": {
      "type": "string"
    }
  },
  "properties": {
        "authMigrations": {
            "title": "AuthMigrations",
            "properties": {
                "id": {
                    "type": "#Id"
                },
                "name": {
                    "type": "string"
                },
                "run_on": {
                    "type": "#DateTime"
                }
            }
        },
        "applications": {
            "title": "Applications",
            "properties": {
                "id": {
                    "type": "#Id"
                },
                "secret": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "url": {
                    "type": "string"
                },
                "redirect_uri": {
                    "type": "string"
                },
                "grant_type": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "policies": {
                    "type": "object"
                },
                "creation_date": {
                    "type": "#DateTime"
                },
                "domains": {
                    "type": "string"
                }
            }
        },
        "users": {
            "title": "Users",
            "properties": {
                "id": {
                    "type": "#Id"
                },
                "username": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "valid_email": {
                    "type": "boolean"
                },
                "password": {
                    "type": "string",
                    "size": "128"
                },
                "salt": {
                    "type": "string",
                    "size": "128"
                },
                "creation_date": {
                    "type": "#DateTime"
                },
                "anonymous": {
                    "type": "boolean"
                },
                "anonymous_token": {
                    "type": "string"
                },
                "anonymous_secret": {
                    "type": "string"
                },
                "account_state": {
                    "type": "string",
                    "size": "20"
                },
                "account_state_updated_at": {
                    "type": "#DateTime"
                }
            }
        },
        "authentications": {
            "title": "Authentications",
            "properties": {
                "id": {
                    "type": "#Id"
                },
                "client_id": {
                    "type": "#Link",
                    "link": "applications.id"
                },
                "user_id": {
                    "type": "#Link",
                    "link": "users.id"
                },
                "redirect_uri": {
                    "type": "string"
                },
                "scope": {
                    "type": "string"
                }
            }
        },
        "sessions": {
            "title": "Sessions",
            "properties": {
                "id": {
                    "type": "#Id"
                },
                "access_token": {
                    "type": "string"
                },
                "expires_in": {
                    "type": "integer"
                },
                "scope": {
                    "type": "array",
                    "arraytype": "string"
                },
                "client_id": {
                    "type": "#Link",
                    "link": "applications.id"
                },
                "user_id": {
                    "type": "#Link",
                    "link": "users.id"
                },
                "created": {
                    "type": "#DateTime"
                },
                "last": {
                    "type": "#DateTime"
                },
                "ua": {
                    "type": "string"
                },
                "lg": {
                    "type": "string"
                },
                "ip": {
                    "type": "string"
                },
                "ref": {
                    "type": "string"
                },
                "ga": {
                    "type": "string"
                },
                "cfduid": {
                    "type": "string"
                }
            }
        }
  }
}