GDPR 준수의 번거로움에 대한 gdpr-guard

신사숙녀 여러분, 다음을 소개하겠습니다: gdpr-guard .


내용의 테이블
  • What is gdpr-guard ?
  • A tiny example

  • The eco-system
  • Storage
  • Bindings / UI generation helpers

  • What do you think?
  • My two cents as the creator (and user)





  • gdpr-guard 란 무엇입니까?

    gdpr-guard is a library that helps with the following tasks:

    • Describe the personal data processing in a tree-like structure
    • Make each feature or group of feature toggleable
    • Make a "cookie banner" workflow for
    • React to the user's choices when validated
    • Keep the data on the user's machine (or save it elsewhere if so desired)

    What gdpr-guard does not help you with: build a uniform potentially themable UI. gdpr-guard is not a UI library, it provides the bare-bones logic and nothing else.

    작은 예

    For this example, we'll use gdpr-guard as well as gdpr-guard-local .

    First, we'll define our manager factory. We use a factory because we will restore the manager from local storage if it already exists.

    import { GdprManagerBuilder, GdprStorage } from "gdpr-guard"
    
    const managerFactory = () => 
      GdprManagerBuilder.make()
        .startRequiredGroup(GdprStorage.Cookie, "Functionalities", "Information purely used to guarantee the proper behavior of the application")
          .withEnabledGuard("PHP_SESSID", "Server session identifier")
        .endGroup()
        .startGroup(GdprStorage.Cookie, "Analytics", "Tracking information used to better the UX")
          .withEnabledGuard("_ga", "Tracking identifier")
        .endGroup()
      .build();
    

    Then we'll use the Savior API, which is used for handling saving and restoring the GDPR settings:

    import { LocalStorageSavior, defaults } from "gdpr-guard-local"
    
    const { makeConfig } = defaults;
    
    const saviorConfig = {
      version: "v1.0.2", // Changing this, depending on your version comparison algorithm, will ask the user to configure their settings again
      storeKey: "gdprState", // The key used to save/restore the user's settings
      versionKey: "gdprVersion", // The key used to save/query the version of the savior the user saw last
      comparator: (lhs, rhs) => return lhs !== rhs, // How to detect if versions are different
    };
    
    const savior = new LocalStorageSavior(saviorConfig);
    

    For the sake of this example, we'll not use any of the bindings. It may seem a little too abstract, but bear with me. At this point you have both a factory and a savior which is all you need to use one.

    Let's get our manager instance and listen to enabling/disabling events:

    async function prepareGdprStuff() {
      // manager is an instance of GdprManager
      const manager = await savior.restoreOrCreate(managerFactory);
    
      manager.events.onEnable("_ga", () => {
        // Load the GA scripts and execute stuff
      });
    
      manager.events.onDisable("_ga", () => {
        // Disable GA if it's already loaded, for when users change their settings mid-execution
      });
    
      if (manager.bannerWasShown) {
        manager.closeBanner();
      }
    
      /*
        Then we render stuff in the modal/banner, use listeners, query enabled state, etc...
      */
    }
    

    And just like that, with little to no effort, you can build a fully GDPR-compliant system with conditional script loading/execution.

    생태계

    저장

    Storage packages follow the following naming convention: gdpr-guard-<storage>. They almost always expose a class implementing the GdprSavior interface.

  • gdpr-guard-local 로컬 저장소에 GDPR 설정을 저장하려면(기본적으로 다음을 수행할 수 있습니다. 자체 스토어 구현도 제공)

  • 바인딩/UI 생성 헬퍼

    Binding packages follow the following naming convention: <binding>-gdpr-guard.

  • dom-gdpr-guard은 GDPR 설정 UI
  • 의 렌더링Element에 도움이 되는 Vanilla JS 바인딩입니다.

  • vue-gdpr-guard은 UI
  • 를 빌드하는 데 도움이 되는 플러그인 및 렌더리스 구성 요소를 제공하는 Vue 2 바인딩입니다.

  • react-gdpr-guard , UI 구축을 지원하는 React 후크 기반 바인딩(WIP)

  • vue3-gdpr-guard은 UI(WIP) 구축에 도움이 되는 구성 API 도구를 제공하는 Vue 3 바인딩입니다.

  • html-gdpr-guard은 DOM(WIP)에 이미 존재하는 정보에서 GDPR 관리자를 구축하는 데 도움이 되는 HTML/Vanilla JS 바인딩입니다.

  • 어떻게 생각해?



    나는 당신이 그것에 대해 어떻게 생각하는지 듣고 싶습니다. 서버 또는 귀하의 서버와 왕복해야 하는 타사 유틸리티와 비교할 때 흥미로워 보입니까? 사용하기 쉬운 느낌? 무엇을 보고 싶으신가요? 무엇을 변경하시겠습니까? 정말 뭐든지.

    적어도 그것을 발견하는 것을 즐겼기를 바랍니다. 개인 및 전문 프로젝트에서 최소 2년 동안 사용했습니다. 지금까지 훌륭하게 작동했습니다.

    제작자(및 사용자)로서의 나의 2센트

    Being able to fully detail every piece of data stored/grabbed is huge and not seen that often. The flexibility of choosing to have groups or not, groups within groups, etc... is pretty nice to have.

    The fact that I designed the API to be mostly asynchronous also helps in situations where sessions are stored in your DB and you'd like to manage that here (e.g. if you conditionally render scripts).

    좋은 웹페이지 즐겨찾기