module ietf-http-client {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-http-client";
prefix httpc;
import ietf-tcp-client {
prefix tcpc;
reference
"RFC AAAA: YANG Groupings for TCP Clients and TCP Servers";
}
import ietf-tls-client {
prefix tlsc;
reference
"RFC BBBB: YANG Groupings for TLS Clients and TLS Servers";
}
import ietf-netconf-acm {
prefix nacm;
reference
"RFC 8341: Network Configuration Access Control Model";
}
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) 2019 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 XXXX
(https://www.rfc-editor.org/info/rfcXXXX); 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 2020-03-08 {
description
"Initial version";
reference
"RFC XXXX: 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";
}
// Groupings
grouping client-identity-grouping {
description
"The credentials used by the client to authenticate to
the HTTP server.";
choice auth-type {
nacm:default-deny-write;
mandatory true;
description
"The authentication type.";
case basic {
container basic {
if-feature "basic-auth";
leaf user-id {
type string;
mandatory true;
description
"The user-id for the authenticating client.";
}
leaf password {
nacm:default-deny-all;
type string;
mandatory true;
description
"The password for the authenticating client.";
}
description
"The 'basic' HTTP scheme credentials.";
reference
"RFC 7617: The 'Basic' HTTP Authentication Scheme";
}
}
}
} // grouping client-identity-grouping
grouping http-client-grouping {
description
"A reusable grouping for configuring a HTTP client,
including the IP address and port number it initiates
a connections to.
Note that this grouping uses fairly typical descendent
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.";
container client-identity {
description
"The identity the HTTP client should use when
authenticating itself to the HTTP server.";
uses client-identity-grouping;
}
container proxy-server {
nacm:default-deny-write;
if-feature "proxy-connect";
presence true; // only so ex-http-client can pass validation?
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 proxy-client-identity {
description
"The identity the HTTP client should use when
authenticating itself to the HTTP server.";
uses client-identity-grouping;
}
description
"Proxy server settings.";
}
} // grouping http-client-grouping
} // module ietf-http-client