Commit 613a7a3c authored by Ben Chan's avatar Ben Chan Committed by Commit Bot

Chrome OS: add ONC translation of APN authentication property

CL:857742 and CL:857743 added the support for APN authentication method
specified in the mobile operator database in shill. CL:1081764 updated shill to
respect the authentication method in the user-specified APN property. This CL
adds the ONC translation of the APN authentication property, so that a
follow-up CL can update the settings UI to allow specifying the APN
authentication for the user-specified APN.

BUG=b:68680371

Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I7e110a3a4841f8ec2ee725cdc799999b51a45746
Reviewed-on: https://chromium-review.googlesource.com/1096430
Commit-Queue: Ben Chan <benchan@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566721}
parent 9256dbd1
......@@ -1955,6 +1955,9 @@
<message name="IDS_ONC_CELLULAR_APN_PASSWORD" desc="ONC Property label for APN-Password">
Password
</message>
<message name="IDS_ONC_CELLULAR_APN_AUTHENTICATION" desc="ONC Property label for APN-Authentication">
Authentication
</message>
<message name="IDS_ONC_CELLULAR_CARRIER" desc="ONC Property label for Cellular.Carrier">
Carrier
</message>
......
......@@ -63,6 +63,7 @@ void AddOncLocalizedStrings(content::WebUIDataSource* html_source) {
IDS_ONC_CELLULAR_APN_ACCESS_POINT_NAME},
{"OncCellular-APN-AccessPointName_none",
IDS_ONC_CELLULAR_APN_ACCESS_POINT_NAME_NONE},
{"OncCellular-APN-Authentication", IDS_ONC_CELLULAR_APN_AUTHENTICATION},
{"OncCellular-APN-Password", IDS_ONC_CELLULAR_APN_PASSWORD},
{"OncCellular-APN-Username", IDS_ONC_CELLULAR_APN_USERNAME},
{"OncCellular-ActivationState", IDS_ONC_CELLULAR_ACTIVATION_STATE},
......
......@@ -868,6 +868,7 @@ void FakeShillManagerClient::SetupDefaultEnvironment() {
base::Value("Localized Test APN"));
apn.SetKey(shill::kApnUsernameProperty, base::Value("User1"));
apn.SetKey(shill::kApnPasswordProperty, base::Value("password"));
apn.SetKey(shill::kApnAuthenticationProperty, base::Value("chap"));
base::DictionaryValue apn2;
apn2.SetKey(shill::kApnProperty, base::Value("testapn2"));
services->SetServiceProperty(kCellularServicePath,
......
......@@ -268,6 +268,7 @@ const OncFieldSignature cellular_apn_fields[] = {
{::onc::cellular_apn::kName, &kStringSignature},
{::onc::cellular_apn::kUsername, &kStringSignature},
{::onc::cellular_apn::kPassword, &kStringSignature},
{::onc::cellular_apn::kAuthentication, &kStringSignature},
{::onc::cellular_apn::kLocalizedName, &kStringSignature},
{::onc::cellular_apn::kLanguage, &kStringSignature},
{NULL}};
......
......@@ -162,6 +162,7 @@ const FieldTranslationEntry cellular_apn_fields[] = {
{::onc::cellular_apn::kName, shill::kApnNameProperty},
{::onc::cellular_apn::kUsername, shill::kApnUsernameProperty},
{::onc::cellular_apn::kPassword, shill::kApnPasswordProperty},
{::onc::cellular_apn::kAuthentication, shill::kApnAuthenticationProperty},
{::onc::cellular_apn::kLocalizedName, shill::kApnLocalizedNameProperty},
{::onc::cellular_apn::kLanguage, shill::kApnLanguageProperty},
{NULL}};
......
......@@ -4,6 +4,7 @@
"Cellular": {
"APN": {
"AccessPointName": "test-apn",
"Authentication": "chap",
"Username": "test-username",
"Password": "test-password"
},
......
......@@ -3,6 +3,7 @@
"Type": "cellular",
"Cellular.APN": {
"apn": "test-apn",
"authentication": "chap",
"username": "test-username",
"password": "test-password"
}
......
......@@ -17,6 +17,7 @@
},
"Cellular.APN": {
"apn": "test-apn",
"authentication": "chap",
"name": "test-apn-name",
"username": "test-username",
"password": "test-password"
......
......@@ -28,6 +28,7 @@
],
"APN": {
"AccessPointName": "test-apn",
"Authentication": "chap",
"Name": "test-apn-name",
"Username": "test-username",
"Password": "test-password"
......
......@@ -1480,6 +1480,10 @@ ONC configuration of of **Cellular** networks is not yet supported.
* (optional) - **string**
* Password for making connections if required.
* **Authentication**
* (optional) - **string**
* Type of authentication protocol for sending username and password.
* **Language**
* (optional, rquired if **LocalizedName** is provided) - **string**
Two letter language code for Localizedname if provided.
......
......@@ -158,6 +158,7 @@ const char kAccessPointName[] = "AccessPointName";
const char kName[] = "Name";
const char kUsername[] = "Username";
const char kPassword[] = "Password";
const char kAuthentication[] = "Authentication";
const char kLocalizedName[] = "LocalizedName";
const char kLanguage[] = "Language";
} // namespace cellular_apn
......
......@@ -171,6 +171,7 @@ ONC_EXPORT extern const char kAccessPointName[];
ONC_EXPORT extern const char kName[];
ONC_EXPORT extern const char kUsername[];
ONC_EXPORT extern const char kPassword[];
ONC_EXPORT extern const char kAuthentication[];
ONC_EXPORT extern const char kLocalizedName[];
ONC_EXPORT extern const char kLanguage[];
} // namespace cellular_apn
......
......@@ -231,6 +231,7 @@ class NetworkingPrivateApiTest : public ApiUnitTest {
.Set(shill::kApnProperty, "test-apn")
.Set(shill::kApnUsernameProperty, "test-user")
.Set(shill::kApnPasswordProperty, "test-password")
.Set(shill::kApnAuthenticationProperty, "chap")
.Build();
std::unique_ptr<base::ListValue> apn_list =
ListBuilder().Append(apn->CreateDeepCopy()).Build();
......@@ -1126,6 +1127,7 @@ TEST_F(NetworkingPrivateApiTest, GetCellularPropertiesFromWebUi) {
.Set("AccessPointName", "test-apn")
.Set("Username", "test-user")
.Set("Password", "test-password")
.Set("Authentication", "chap")
.Build();
std::unique_ptr<base::DictionaryValue> expected_result =
DictionaryBuilder()
......
......@@ -154,6 +154,7 @@ namespace networkingPrivate {
dictionary APNProperties {
DOMString AccessPointName;
DOMString? Authentication;
DOMString? Language;
DOMString? LocalizedName;
DOMString? Name;
......@@ -163,6 +164,7 @@ namespace networkingPrivate {
dictionary ManagedAPNProperties {
ManagedDOMString AccessPointName;
ManagedDOMString? Authentication;
ManagedDOMString? Language;
ManagedDOMString? LocalizedName;
ManagedDOMString? Name;
......
......@@ -189,6 +189,7 @@ chrome.networkingPrivate.ManagedProxySettingsType;
/**
* @typedef {{
* AccessPointName: string,
* Authentication: (string|undefined),
* Language: (string|undefined),
* LocalizedName: (string|undefined),
* Name: (string|undefined),
......@@ -202,6 +203,7 @@ chrome.networkingPrivate.APNProperties;
/**
* @typedef {{
* AccessPointName: !chrome.networkingPrivate.ManagedDOMString,
* Authentication: (!chrome.networkingPrivate.ManagedDOMString|undefined),
* Language: (!chrome.networkingPrivate.ManagedDOMString|undefined),
* LocalizedName: (!chrome.networkingPrivate.ManagedDOMString|undefined),
* Name: (!chrome.networkingPrivate.ManagedDOMString|undefined),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment