All Downloads are FREE. Search and download functionalities are using the official Maven repository.

plugins.http.conf Maven / Gradle / Ivy

There is a newer version: 0.5.0
Show newest version
# Copyright 2018 UANGEL
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name = "thing2x-core-http"
class = com.thing2x.smqd.net.http.HttpService
multi-instantiable = true

default-config {
  cors.enabled = true

  oauth2 {
    simulation_mode = false
    simulation_identifier = admin
    secret_key = "change_me_!"
    token_expire = 30m
    refresh_token_expire = 4h
    algorithm = HS256
  }

  local {
    enabled = true
    address = 127.0.0.1
    port = 80
    bind.address = 0.0.0.0
    #
    # default is using local.port
    #
    # bind.port = 80
  }

  local.secure {
    enabled = false
    address = 127.0.0.1
    port = 443
    bind.address = 0.0.0.0
    #
    # default is using local.secure.port
    #
    # bind.port = 443
  }

  routes = []
}

config-schema {
  sections = [
    {
      title = "General"
      rows = [
        {
          columns = [
            {
              key = cors.enabled
              type = boolean
              title = "Enable CORS"
            }
          ]
        }
      ]
    },
    {
      title = "Listener"
      rows = [
        {
          columns = [
            {
              key = local.enabled
              type = boolean
              title = "Enable plain socket listener"
            }
          ]
        },
        {
          columns = [
            {
              key = local.address
              type = string
              title = "Plain socket address"
            },
            {
              key = local.port
              type = integer
              title = "Port"
            }
          ]
        },
        {
          columns = [
            {
              key = local.bind.address
              type = string
              title = "Plain socket binding address"
            },
            {
              key = local.bind.port
              type = integer
              title = "Port"
              placeholder = "default is using the same port"
            }
          ]
        }
      ]
    },
    {
      title = "TLS Listener"
      rows = [
        {
          type = "default"
          columns = [
            {
              key = local.secure.enabled
              type = boolean
              title = "Enable TLS socket listener"
            }
          ]
        },
        {
          type = "default"
          columns = [
            {
              key = local.secure.address
              type = string
              title = "TLS socket address"
            },
            {
              key = local.secure.port
              type = integer
              title = "Port"
            }
          ]
        },
        {
          type = "default"
          columns = [
            {
              key = local.secure.bind.address
              type = string
              title = "TLS socket binding address"
            },
            {
              key = local.secure.bind.port
              type = integer
              title = "Port"
              placeholder = "default is using the same TLS port"
            }
          ]
        }
      ]
    },
    {
      //   oauth2 {
      //    token_expire = 30m
      //    refresh_token_expire = 4h
      //    algorithm = HS256
      //  }
      title = "OAuth2"
      rows = [
        {
          columns = [
            {
              key = "oauth2.enabled"
              type = boolean
              title = "Enable oauth2"
            },
            {
              key = "oauth2.secret_key"
              type = string
              title = "Secret key"
            },
            {
              key = "oauth2.algorithm"
              type = string
              title = "Algorithm"
              enum = ["HMD5", "HS224", "HS256", "HS384", "HS512"]
            }
          ]
        },
        {
          columns = [
            {
              key = "oauth2.token_expire"
              type = string // "duration" type is not implmented yet
              title = "Token expire in ..."
            },
            {
              key = "oauth2.refresh_token_expire"
              type = string // "duration" type is not implmented yet
              title = "Refresh token expre in ..."
            }
          ]
        }
      ]
    },
    {
      title = "Routes"
      rows = [
        {
          type = growable
          columns = [
            {
              key = "routes.#.name"
              type = string
              title = "Name"
            },
            {
              key = "routes.#.prefix"
              type = string
              title = "Prefix"
            },
            {
              key = "routes.#.class"
              type = string
              title = "Controller Class"
            }
          ]
        }
      ]
    }
  ]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy