Files
Gnuboard7/plugins/_bundled/sirsoft-gdpr/dist/js/plugin.iife.js
T
HeuJung bd215bc586 feat(identity): NHN KCP 휴대폰 본인확인 플러그인 추가
메일 인증 대신 휴대폰 본인확인을 쓸 수 있게 하는 플러그인을 추가한다.
가입·비밀번호 재설정·성인인증 등 코어 IDV 가 강제하는 모든 지점에서 동작하며,
테스트 모드로 계약 없이 전 흐름을 확인할 수 있다.

구현·검수 과정에서 드러난 저장소 전역 결함을 함께 처리했다.

- 외래키 컬럼의 한국어 comment 가 방출되지 않던 문제 (소스 38건 교정 +
 기설치본 백필 업그레이드 스텝 7종). ->comment 를 ->constrained 뒤에
 체인하면 예외 없이 통과하면서 comment 가 조용히 사라진다
- 로케일 전환 후 확장 액션 핸들러가 소실되던 문제 (플러그인 3종에
 재등록 진입점 노출)
- 본인인증 상태 폴링 응답이 누적 시도 횟수를 함께 내보내던 문제
- 인증 안내 문구와 실제 진행 방식의 폭 경계 불일치 (768~1023px).
 엔진과 같은 값을 같은 방법으로 읽도록 교정
- transition_overlay_target 이 replace 없이 무효이던 관리자 목록 40곳.
 로딩 표시가 나오지 않아도 경고가 남지 않아 화면을 봐야만 알 수 있었다

두 인증 플러그인의 코어 최소 요구 버전을 7.0.6 으로 올린다. 운영 모드
자격증명 필수 검사가 7.0.6 의 설정 저장 검증 표면에 의존하며, 그보다 낮은
코어에서는 그 검사가 조용히 통과해 빈 자격증명으로 저장할 수 있었다.

재발 차단으로 정적 검사 룰 4종을 신설하고, 검사 도구가 미커밋 신규 확장을
"검사 파일 0" 으로 통과시키던 사각을 함께 막았다.
2026-07-31 00:32:46 +09:00

3 lines
9.7 KiB
JavaScript

var SirsoftGdpr=(function(p){"use strict";function Z(e,t){const n=e.toLowerCase(),r=t.toLowerCase();if(r.startsWith("*.")){const o=r.slice(1);return n.endsWith(o)&&n!==o.slice(1)}return n===r}function R(e,t){if(typeof window>"u"||typeof URL>"u")return null;let n,r;try{const o=new URL(e,window.location.href);r=o.protocol,n=o.hostname}catch{return null}if(r!=="http:"&&r!=="https:"||n===""||n===window.location.hostname)return null;for(const[o,i]of Object.entries(t))if(o!=="necessary"){for(const s of i)if(Z(n,s))return o}return null}const b="data-gdpr-category",_="gdpr-blocked-embed",j="data-gdpr-original",k=[`script[${b}]`,`iframe[${b}]`,"script[src]","iframe[src]","img[src]","link[href]"].join(", ");let l=null,y={categories:{},needs_renewal:!1},N={};function P(e){if(e&&typeof e=="object"&&"categories"in e){const t=e;return{categories:{...t.categories},needs_renewal:t.needs_renewal===!0}}return{categories:{...e},needs_renewal:!1}}function H(e){y=P(e),l!==null&&m()}function ee(e){N={...e},l!==null&&m()}function te(){typeof document>"u"||l!==null||(m(),l=new MutationObserver(e=>{for(const t of e)t.addedNodes.forEach(n=>{n instanceof HTMLElement&&re(n)})}),l.observe(document.documentElement,{childList:!0,subtree:!0}),window.addEventListener("gdpr:consent-changed",ne))}function ne(e){const t=e.detail;t!==null&&typeof t=="object"&&(y=P(t)),m()}function re(e){ie(e)&&C(e),e.querySelectorAll(k).forEach(t=>C(t))}function m(){typeof document>"u"||(document.querySelectorAll(`.${_}`).forEach(e=>{const t=e.dataset.gdprBlockedCategory;t&&A(t)&&se(e)}),document.querySelectorAll(k).forEach(e=>C(e)))}function C(e){if(e.classList.contains(_)||e.hasAttribute("data-gdpr-blocked-category"))return;const t=e.getAttribute(b);if(t!==null&&t!==""){if(A(t))return;M(e,t);return}const n=oe(e);if(n===null)return;const r=R(n,N);r!==null&&(A(r)||M(e,r))}function oe(e){return e instanceof HTMLScriptElement||e instanceof HTMLIFrameElement||e instanceof HTMLImageElement?e.getAttribute("src"):e instanceof HTMLLinkElement?e.getAttribute("href"):null}function ie(e){if(typeof e.matches!="function")return!1;try{return e.matches(k)}catch{return!1}}function M(e,t){const n=document.createElement("div");n.className=_,n.dataset.gdprBlockedCategory=t,n.dataset.gdprOriginalTag=e.tagName.toLowerCase(),n.setAttribute(j,e.outerHTML),n.setAttribute("aria-hidden","true"),n.style.display="none",e.replaceWith(n)}function se(e){const t=e.getAttribute(j);if(!t){e.remove();return}const n=document.createElement("div");n.innerHTML=t;const r=n.firstElementChild;r!==null?e.replaceWith(r):e.remove()}function A(e){return e==="necessary"?!0:y.needs_renewal?!1:y.categories[e]===!0}const ce=500,ae=["click","keydown","change","submit","pointerdown","touchstart"];let B=!1,E=0;function le(e){e.isTrusted&&(E=Date.now())}function ue(){if(!B){B=!0;for(const e of ae){const t=le;window.addEventListener(e,t,{capture:!0,passive:!0})}}}function G(){const e=window.event;return e&&e.isTrusted?!0:E===0?!1:Date.now()-E<=ce}const u=["XSRF-TOKEN","laravel_session","laravel_maintenance","gdpr_session"];let T=!1,a=null,w={functionalConsented:!1,necessaryAllowlist:u};function fe(e){const t=e.indexOf("=");return t<=0?null:e.substring(0,t).trim()}function de(e){return w.necessaryAllowlist.includes(e)}function ge(e){const t=fe(e);return t===null?!1:!!(pe(e)||de(t)||w.functionalConsented||G())}function pe(e){const t=e.toLowerCase(),n=t.match(/max-age\s*=\s*(-?\d+)/);return!!(n&&parseInt(n[1],10)<=0||t.includes("expires=thu, 01 jan 1970")||t.includes("expires=thu, 01-jan-1970"))}function ye(e){if(T)return;if(T=!0,w=e,a=Object.getOwnPropertyDescriptor(Document.prototype,"cookie")??null,!a||!a.set||!a.get){T=!1;return}const t=a.set,n=a.get;Object.defineProperty(Document.prototype,"cookie",{configurable:!0,get(){return n.call(this)},set(r){ge(r)&&t.call(this,r)}})}function $(e){w=e}const f=[{key:"g7_locale",storage:"localStorage",matchType:"exact"},{key:"auth_token",storage:"localStorage",matchType:"exact"},{key:"g7_cache_version",storage:"localStorage",matchType:"exact"},{key:"g7_cart_key",storage:"localStorage",matchType:"exact"},{key:"g7-devtools-panel",storage:"localStorage",matchType:"exact"},{key:"g7_devtools_",matchType:"prefix"},{key:"g7_filters_",matchType:"prefix"},{key:"g7_columns_",matchType:"prefix"},{key:"g7_order_",matchType:"prefix"}];let U=!1,S=null,h={functionalConsented:!1,necessaryAllowlist:f};function me(e,t){for(const n of h.necessaryAllowlist){if(n.storage&&n.storage!==t)continue;const r=n.matchType??"exact";if(r==="exact"&&n.key===e||r==="prefix"&&e.startsWith(n.key))return!0}return!1}function we(e,t){return!!(me(e,t)||h.functionalConsented||G())}function he(e){if(U)return;U=!0,h=e;const t=Storage.prototype;S=t.setItem,t.setItem=function(n,r){const o=this===window.sessionStorage?"sessionStorage":"localStorage";we(n,o)&&S&&S.call(this,n,r)}}function W(e){h=e}function be(e,t,n){for(const r of n){if(r.storage&&r.storage!==t)continue;const o=r.matchType??"exact";if(o==="exact"&&r.key===e||o==="prefix"&&e.startsWith(r.key))return!0}return!1}function F(e,t,n){const r=[];for(let o=0;o<e.length;o++){const i=e.key(o);i!==null&&r.push(i)}for(const o of r)if(!be(o,t,n))try{e.removeItem(o)}catch{}}function _e(e){const t=document.cookie;if(!t)return;const n=t.split(";");for(const r of n){const o=r.indexOf("="),i=(o>-1?r.substring(0,o):r).trim();if(i&&!e.includes(i))try{document.cookie=`${i}=; Max-Age=0; Path=/`}catch{}}}function K(e={}){const t=e.storageAllowlist??f,n=e.cookieAllowlist??u;F(window.localStorage,"localStorage",t),F(window.sessionStorage,"sessionStorage",t),_e(n)}let L=null;function ke(){if(typeof window>"u")return null;const t=window.G7Core?.api;return t&&typeof t.get=="function"?t:null}async function q(e){const t=ke();if(t)try{return await t.get(e)}catch{return null}try{const n=await fetch("/api"+e,{method:"GET",headers:{Accept:"application/json"},credentials:"same-origin"});return n.ok?await n.json():null}catch{return null}}async function Ce(){if(L)return L;const t=(await q("/plugins/sirsoft-gdpr/settings"))?.data;return t?(L=t,t):null}async function Y(){const e=await q("/plugins/sirsoft-gdpr/consent/cookie/status"),t=e?.data?.consents;return t==null?null:{categories:t,needs_renewal:e?.data?.needs_renewal===!0,current_policy_version:String(e?.data?.current_policy_version??"")}}const D="data-gdpr-blocked-src",I="data-gdpr-blocked-category",Ae="data-gdpr-category";let z=!1,d={blockedDomains:{},consent:{necessary:!0},needs_renewal:!1};function O(e){return e==="necessary"?!0:d.needs_renewal===!0?!1:d.consent?.[e]===!0}function Ee(e,t){const n=e.getAttribute(Ae);if(n!==null&&n!=="")return O(n)?null:n;const r=R(t,d.blockedDomains);return r===null||O(r)?null:r}function Te(e){if(d={blockedDomains:e.blockedDomains??{},consent:e.consent??{necessary:!0},needs_renewal:e.needs_renewal===!0},z||typeof HTMLScriptElement>"u")return;const t=Object.getOwnPropertyDescriptor(HTMLScriptElement.prototype,"src");t===void 0||typeof t.set!="function"||(Object.defineProperty(HTMLScriptElement.prototype,"src",{configurable:!0,enumerable:t.enumerable??!0,get(){return t.get?.call(this)??""},set(n){const r=Ee(this,n);if(r!==null){this.setAttribute(D,n),this.setAttribute(I,r);return}t.set.call(this,n)}}),z=!0)}function v(e){d={blockedDomains:e.blockedDomains??{},consent:e.consent??{necessary:!0},needs_renewal:e.needs_renewal===!0}}function J(e){if(!O(e)||typeof document>"u")return;document.querySelectorAll(`script[${I}="${e}"]`).forEach(n=>{const r=n.getAttribute(D);if(r===null||r==="")return;const o=document.createElement("script");for(const s of Array.from(n.attributes))s.name===D||s.name===I||s.name==="src"||o.setAttribute(s.name,s.value);const i=n.parentNode;i!==null&&(i.replaceChild(o,n),o.src=r)})}const g="sirsoft-gdpr";function X(){if(typeof window>"u")return{};const n=window.G7Config?.plugins?.[g]?.blocked_domains;if(n==null||typeof n!="object")return{};const r={};for(const[o,i]of Object.entries(n)){if(!Array.isArray(i))continue;const s=i.filter(c=>typeof c=="string"&&c!=="");s.length>0&&(r[o]=s)}return r}function Se(){return typeof window>"u"?!1:window.G7Config?.plugins?.[g]?.banner_enabled===!0}function x(){const e=window.G7Core?.getActionDispatcher?.();if(!e){setTimeout(x,100);return}e.registerHandler(`${g}.syncConsent`,async()=>{const t=await Y();if(t===null)return;const n=!t.needs_renewal&&t.categories.functional===!0;H({categories:t.categories,needs_renewal:t.needs_renewal});const r=X();if(v({blockedDomains:r,consent:t.categories,needs_renewal:t.needs_renewal}),W({functionalConsented:n,necessaryAllowlist:f}),$({functionalConsented:n,necessaryAllowlist:u}),n||K(),!t.needs_renewal)for(const[o,i]of Object.entries(t.categories))i===!0&&o!=="necessary"&&J(o)})}async function Q(){if(typeof window>"u")return;if(x(),Se()){const c=X();Te({blockedDomains:c,consent:{necessary:!0}}),ue(),he({functionalConsented:!1,necessaryAllowlist:f}),ye({functionalConsented:!1,necessaryAllowlist:u})}const t=await Ce();if(!t||!(t.banner_enabled===!0))return;const r=t.blocked_domains??{};ee(r),v({blockedDomains:r,consent:{necessary:!0}}),te();const i=await Y(),s=i!==null&&!i.needs_renewal&&i.categories.functional===!0;if(W({functionalConsented:s,necessaryAllowlist:f}),$({functionalConsented:s,necessaryAllowlist:u}),s||K(),i!==null&&(H({categories:i.categories,needs_renewal:i.needs_renewal}),v({blockedDomains:r,consent:i.categories,needs_renewal:i.needs_renewal}),!i.needs_renewal))for(const[c,Le]of Object.entries(i.categories))Le===!0&&c!=="necessary"&&J(c)}function V(){x()}return typeof window<"u"&&(window.__SirsoftGdpr={identifier:g,initPlugin:V}),typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{Q()}):Q()),p.PLUGIN_IDENTIFIER=g,p.initPlugin=V,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),p})({});
//# sourceMappingURL=plugin.iife.js.map