terraform-provider-hydra

command module
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 2 Imported by: 0

README

Terraform Hydra Provider

This provider is used to manage ory/hydra resources through Hydra Admin API.

Supported resources:

  • OAuth2 Clients (hydra_oauth2_client resource)
  • JWKS (hydra_jwks resource and data source)

See ory/hydra REST API docs for description of resources.

Example usage

terraform {
  required_providers {
    hydra = {
      source = "svrakitin/hydra"
      version = "0.5.0"
    }
  }
}

provider "hydra" {
  endpoint = "http://hydra-admin.localhost"
}

resource "hydra_jwks" "generated" {
  name = "generated"

  generator {
    alg = "RS256"
    kid = "generated"
    use = "sig"

    keepers = {
      version = 1
    }
  }
}

data "hydra_jwks" "default" {
  name = "hydra.openid.id-token"
}

resource "hydra_oauth2_client" "example" {
  client_id   = "example"
  client_name = "example"

  redirect_uris = ["http://localhost:8080/callback"]
  
  response_types             = ["code"]
  token_endpoint_auth_method = "none"
}

Authentication

Basic Auth

Support for Basic Auth on the Hydra Admin API is available.

provider "hydra" {
  endpoint = "http://hydra-admin.localhost"

  authentication {
    basic {
      username = var.hydra_admin_basic_auth_username
      password = var.hydra_admin_basic_auth_password
    }
  }
}
HTTP header

Support for auth using an arbitrary HTTP request header is available. The header name defaults to Authorization if not otherwise set.

provider "hydra" {
  endpoint = "http://hydra-admin.localhost"

  authentication {
    http_header {
      name  = var.hydra_admin_auth_http_header_name
      value = var.hydra_admin_auth_http_header_value
    }
  }
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL