module ietf-http-client {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-http-client";
prefix httpc;
import ietf-netconf-acm {
prefix nacm;
reference
"RFC 8341: Network Configuration Access Control Model";
}
import ietf-crypto-types {
prefix ct;
reference
"RFC AAAA: YANG Data Types and Groupings for Cryptography";
}
import ietf-tcp-client {
prefix tcpc;
reference
"RFC DDDD: YANG Groupings for TCP Clients and TCP Servers";
}
import ietf-tls-client {
prefix tlsc;
reference
"RFC FFFF: YANG Groupings for TLS Clients and TLS Servers";
}
organization
"IETF NETCONF (Network Configuration) Working Group";
contact
"WG Web:
WG List:
Author: Kent Watsen ";
description
"This module defines reusable groupings for HTTP clients that
can be used as a basis for specific HTTP client instances.
Copyright (c) 2021 IETF Trust and the persons identified
as authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with
or without modification, is permitted pursuant to, and
subject to the license terms contained in, the Simplified
BSD License set forth in Section 4.c of the IETF Trust's
Legal Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC GGGG
(https://www.rfc-editor.org/info/rfcGGGG); see the RFC
itself for full legal notices.
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
are to be interpreted as described in BCP 14 (RFC 2119)
(RFC 8174) when, and only when, they appear in all
capitals, as shown here.";
revision 2021-12-14 {
description
"Initial version";
reference
"RFC GGGG: YANG Groupings for HTTP Clients and HTTP Servers";
}
// Features
feature proxy-connect {
description
"Proxy connection configuration is configurable for
HTTP clients on the server implementing this feature.";
}
feature basic-auth {
description
"The 'basic-auth' feature indicates that the client
may be configured to use the 'basic' HTTP authentication
scheme.";
reference
"RFC 7617: The 'Basic' HTTP Authentication Scheme";
}
feature tcp-supported {
description
"Indicates that the server supports HTTP/TCP.";
}
feature tls-supported {
description
"Indicates that the server supports HTTP/TLS.";
}
// Groupings
grouping http-client-identity-grouping {
description
"A grouping to provide HTTP credentials used by the
client to authenticate itself to the HTTP server.";
container client-identity {
nacm:default-deny-write;
presence
"Indicates that a client identity has been configured.
This statement is present so the mandatory descendant
nodes do not imply that this node must be configured.";
description
"The identity the HTTP client should use when
authenticating itself to the HTTP server.";
choice auth-type {
mandatory true;
description
"A choice amongst available authentication types.";
case basic {
container basic {
if-feature "basic-auth";
leaf user-id {
type string;
mandatory true;
description
"The user-id for the authenticating client.";
}
uses ct:password-grouping {
description
"The password for the authenticating client.";
}
description
"The 'basic' HTTP scheme credentials.";
reference
"RFC 7617: The 'Basic' HTTP Authentication Scheme";
}
}
}
}
} // grouping http-client-identity-grouping
grouping http-client-grouping {
description
"A reusable grouping for configuring a HTTP client.
This grouping is expected to be used in conjunction with
other configurations providing, e.g., the hostname or IP
address and port number the client initiates connections
to.
Note that this grouping uses fairly typical descendant
node names such that a stack of 'uses' statements will
have name conflicts. It is intended that the consuming
data model will resolve the issue (e.g., by wrapping
the 'uses' statement in a container called
'http-client-parameters'). This model purposely does
not do this itself so as to provide maximum flexibility
to consuming models.";
uses http-client-identity-grouping;
container proxy-connect {
nacm:default-deny-write;
if-feature "proxy-connect";
presence
"Indicates that a proxy server connections have been
configured. This statement is present so the mandatory
descendant nodes do not imply that this node must be
configured.";
description
"Configures the proxy server the HTTP-client is to
connect thru.";
choice proxy-type {
mandatory true;
description
"Choice amongst proxy server types.";
case http {
container http-proxy {
description
"Container for HTTP Proxy (Web Proxy) server
configuration parameters.";
container tcp-client-parameters {
description
"A wrapper around the TCP parameters to avoid
name collisions.";
uses tcpc:tcp-client-grouping;
}
container http-client-parameters {
description
"A wrapper around the HTTP parameters to avoid
name collisions.";
uses http-client-identity-grouping;
}
}
}
case https {
container https-proxy {
description
"Container for HTTPS Proxy (Secure Web Proxy) server
configuration parameters.";
container tcp-client-parameters {
description
"A wrapper around the TCP parameters to avoid
name collisions.";
uses tcpc:tcp-client-grouping;
}
container tls-client-parameters {
description
"A wrapper around the TLS parameters to avoid
name collisions.";
uses tlsc:tls-client-grouping;
}
container http-client-parameters {
description
"A wrapper around the HTTP parameters to avoid
name collisions.";
uses http-client-identity-grouping;
}
}
}
}
}
} // grouping http-client-grouping
grouping http-client-stack-grouping {
description
"A grouping that defines common HTTP-based protocol stacks.";
choice transport {
mandatory true;
description
"Choice amongst various transports type. TCP, with and
without TLS are defined here, with 'feature' statements
so that they may be disabled. Other transports MAY be
augmented in as 'case' statements by future efforts.";
case tcp {
if-feature "tcp-supported";
container tcp {
description
"Container for TCP-based HTTP protocols.";
container tcp-client-parameters {
description
"A wrapper around the TCP parameters to avoid
name collisions.";
uses tcpc:tcp-client-grouping;
}
container http-client-parameters {
description
"A wrapper around the HTTP parameters to avoid
name collisions.";
uses http-client-grouping;
}
}
}
case tls {
if-feature "tls-supported";
container tls {
description
"Container for TLS-based HTTP protocols.";
container tcp-client-parameters {
description
"A wrapper around the TCP parameters to avoid
name collisions.";
uses tcpc:tcp-client-grouping;
}
container tls-client-parameters {
description
"A wrapper around the TLS parameters to avoid
name collisions.";
uses tlsc:tls-client-grouping;
}
container http-client-parameters {
description
"A wrapper around the HTTP parameters to avoid
name collisions.";
uses http-client-grouping;
}
}
}
}
} // http-client-stack-grouping
}