fix(performance): 구글 광고 INVALID_LOGIN_CUSTOMER_ID 안내 + 저장된 일반 칸을 비우면 지워지게

- 로그인 고객 ID(MCC) 오류에 "직접 추가했다면 칸을 비우고, MCC 면 서비스 계정을 추가한 그 MCC 번호" 안내
- API 설정 창: 저장값이 보이던 일반(비밀 아님) 선택 칸을 비우면 [저장] 때 지우고(clear), [연결 테스트]도 빈 값으로 시험
  (예전엔 빈 칸 = 기존 값 유지라 한 번 넣은 MCC 번호를 지울 수 없었음)
- performance.js 20261015b

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-15 15:24:47 +09:00
parent 42d2671f80
commit 4eda10df00
9 changed files with 60 additions and 19 deletions
@@ -129,6 +129,15 @@ def test_errors_are_explained(monkeypatch):
src.fetch_days(_ctx(), date(2026, 10, 1), date(2026, 10, 1))
assert "USER_PERMISSION_DENIED" in e.value.message and "액세스 및 보안" in e.value.message
# 사용자 화면 오류(2026-10-15): 로그인 고객 ID(MCC) 칸에 권한 없는 번호 → 칸을 비우라는 안내
bad_login = [{"error": {"code": 403, "message": "PERMISSION_DENIED", "details": [{"errors": [
{"errorCode": {"authorizationError": "INVALID_LOGIN_CUSTOMER_ID"},
"message": "The login customer id header 'Optional[9998887777]' could not be validated."}]}]}}]
_install(monkeypatch, lambda req: httpx.Response(403, json=bad_login))
with pytest.raises(AuthFailed) as e:
src.fetch_days(_ctx(login_customer_id="999-888-7777"), date(2026, 10, 1), date(2026, 10, 1))
assert "INVALID_LOGIN_CUSTOMER_ID" in e.value.message and "칸을 지우고" in e.value.message
_install(monkeypatch, lambda req: httpx.Response(404, text="Not Found"))
with pytest.raises(ApiError) as e:
src.fetch_days(_ctx(api_version="v19"), date(2026, 10, 1), date(2026, 10, 1))
@@ -180,6 +189,17 @@ def test_ad_credentials_use_own_namespace():
assert aad_for("google", "service_account_json", "ad:") == "perf:ad:google:service_account_json"
with pytest.raises(Exception):
crypto.decrypt(t.rows[("google", "service_account_json")], aad=aad_for("google", "service_account_json"), ring=ring)
# 저장된 일반 항목을 화면에서 비우고 [연결 테스트] → 그 항목은 빈 값으로(저장값 무시), 새 입력값이 있으면 그 값
svc.save(ga.GoogleAdsSource(), {"login_customer_id": "999-888-7777"}, user="king")
acc = svc.accessor("google", cleared={"login_customer_id"})
assert acc.get("login_customer_id") == "" and not acc.has("login_customer_id") and acc.get("customer_id") == "1234567890"
assert svc.accessor("google").get("login_customer_id") == "999-888-7777"
acc = svc.accessor("google", overrides={"login_customer_id": "111-222-3333"}, cleared={"login_customer_id"})
assert acc.get("login_customer_id") == "111-222-3333"
# [저장] 때 clear 로 보내면 지워진다(빈 칸 = 유지가 아니라 지움)
t.delete_credential = lambda code, key: t.rows.pop((code, key))
svc.save(ga.GoogleAdsSource(), {}, clear=["login_customer_id"], user="king")
assert ("google", "login_customer_id") not in t.rows
class FakeStore: