WL#12952: Authenticating HTTP Component against MySQL Innodb Cluster metadata

Affects: Server-8.0   —   Status: Complete

Motivation

MySQL Router's HTTP Component supports authentication against a local file based credential storage (WL#12503).

User Stories

  1. As a user of MySQL InnoDB Cluster I want to manage the accounts of the HTTP interface of all routers of a cluster from one central place.
  2. As a user of MySQL InnoDB Cluster I want to use the REST APIs even if the communication to the cluster is later lost.

Goal

Allow to

  • manage the accounts of the http component via the MySQL Shell
  • authenticate against accounts stored in the metadata-servers of InnoDB Cluster.
  • using the REST APIs even through communication to the metadata-servers is lost.

Background

In WL#13386 InnoDB Cluster metadata Version 2.0.0 introduced a table router_rest_accounts:

CREATE TABLE `router_rest_accounts` (
  `cluster_id` char(36) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
  `user` varchar(256) NOT NULL,
  `authentication_method` varchar(64) NOT NULL DEFAULT 'modular_crypt_format',
  `authentication_string` text CHARACTER SET ascii COLLATE ascii_general_ci,
  `description` varchar(255) DEFAULT NULL,
  `privileges` json DEFAULT NULL,
  `attributes` json DEFAULT NULL,
  PRIMARY KEY (`cluster_id`,`user`)
)
user
username of the HTTP client
authentication_method
modular_crypt_format for MCF style password hashes.
authentication_string
authentication string according to authentication_method
privileges
NULL means "all privileges".
attributes
unused

Design Requirements

DesignReq1
A HTTP client MUST be able to authenticate against accounts stored in the innodb-cluster metadata.
DesignReq2
Accounts in the innodb-cluster metadata MUST be manageable through SQL.
DesignReq3
Privileges of Accounts in the innodb-cluster metadata MUST be NULL to signal "all privileges".
DesignReq3
Accounts and their privileges MUST be cached on the router at runtime.

Security Requirements

SecReq1
Account Data MUST be stored securely in the metadata tables.
SeqReq2
Time until the auth-cache is invalidated MUST be configurable.