Google Workspace 부가기능 매니페스트

부가기능은 매니페스트 파일을 사용합니다. 앱 및 앱 작동에 대한 특정 세부정보를 구성합니다.

이 문서에서는 Google Workspace 부가기능.

Google Workspace 부가기능의 매니페스트 구조

Google Workspace 부가기능은 매니페스트 파일을 사용하여 부가기능 확인할 수 있습니다.

Google Workspace 부가기능의 매니페스트 속성은 다음과 같습니다. 매니페스트 객체 구조의 addOns 섹션에 정리되어 있습니다.

Google Workspace 부가기능 매니페스트 구성 샘플

다음 매니페스트 샘플은 매니페스트 파일에서 Google Workspace 부가기능(다음 사항 포함)

  • addOns.common 섹션에서 이름, 로고 URL, 색상 및 기타 호스트와 무관한 일반적인 설정입니다.
  • 매니페스트는 공통 홈페이지를 정의하지만, 캘린더, 드라이브, 문서, 스프레드시트, 프레젠테이션 전용 홈페이지 Gmail은 기본 홈페이지를 사용합니다.
  • 샘플 매니페스트 설정은 다음을 사용 설정합니다. <ph type="x-smartling-placeholder">
      </ph>
    • 캘린더 eventOpeneventUpdated 트리거
    • (Apps Script만 해당) 캘린더 2개 컨퍼런스 솔루션입니다.
    • 두 가지 범용 작업
    • 드라이브 onItemsSelectedTrigger.
    • Gmail 편지쓰기 작업 및 상황별 트리거
    • Docs linkPreviewTriggers 객체. 이 트리거에 대해 알아보려면 스마트 칩으로 링크 미리보기를 참고하세요.
    • Docs createActionTriggers 객체입니다. 이 트리거에 대해 알아보려면 @ 메뉴에서 서드 파티 리소스 만들기를 참조하세요.
    • Docs, Sheets, 파일 전용 인터페이스 Google Slides
  • oauthScopes 필드 프로젝트의 승인 범위를 설정합니다 (일반적으로 부가기능).
  • (Apps Script만 해당) urlFetchWhitelist 필드는 가져온 엔드포인트가 지정된 HTTPS URL 프리픽스 목록입니다. 자세한 내용은 URL 허용 목록.

샘플의 링크는 설명으로 연결됩니다. 해당 필드의 Apps Script에 대한 매니페스트 참조 문서 및 HTTP Google Workspace 부가기능.

Apps Script

{
  "addOns": {
    "calendar": {
      "createSettingsUrlFunction": "getConferenceSettingsPageUrl",
      "conferenceSolution": [{
        "id": "my-video-conf",
        "logoUrl": "https://lh3.googleusercontent.com/...",
        "name": "My Video Conference",
        "onCreateFunction": "onCreateMyVideoConference"
      }, {
        "id": "my-streamed-conf",
        "logoUrl": "https://lh3.googleusercontent.com/...",
        "name": "My Streamed Conference",
        "onCreateFunction": "onCreateMyStreamedConference"
      }],
      "currentEventAccess": "READ_WRITE",
      "eventOpenTrigger": {
        "runFunction": "onCalendarEventOpen"
      },
      "eventUpdateTrigger": {
        "runFunction": "onCalendarEventUpdate"
      },
      "eventAttachmentTrigger": {
        "label": "My Event Attachment",
        "runFunction": "onCalendarEventAddAttachment"
      },
      "homepageTrigger": {
        "runFunction": "onCalendarHomePageOpen",
        "enabled": true
      }
    },
    "common": {
      "homepageTrigger": {
        "runFunction": "onDefaultHomePageOpen",
        "enabled": true
      },
      "layoutProperties": {
        "primaryColor": "#ff392b",
        "secondaryColor": "#d68617"
      },
      "logoUrl": "https://ssl.gstatic.com/docs/script/images/logo/script-64.png",
      "name": "Demo Google Workspace Add-on",
      "openLinkUrlPrefixes": [
        "https://mail.google.com/",
        "https://script.google.com/a/google.com/d/",
        "https://drive.google.com/a/google.com/file/d/",
        "https://www.example.com/"
      ],
      "universalActions": [{
        "label": "Open settings",
        "runFunction": "getSettingsCard"
      }, {
        "label": "Open Help URL",
        "openLink": "https://www.example.com/help"
      }],
      "useLocaleFromApp": true
    },
    "drive": {
      "homepageTrigger": {
        "runFunction": "onDriveHomePageOpen",
        "enabled": true
      },
      "onItemsSelectedTrigger": {
        "runFunction": "onDriveItemsSelected"
      }
    },
    "gmail": {
      "composeTrigger": {
        "selectActions": [
          {
            "text": "Add images to email",
            "runFunction": "getInsertImageComposeCards"
          }
        ],
        "draftAccess": "METADATA"
      },
      "contextualTriggers": [
        {
          "unconditional": {},
          "onTriggerFunction": "onGmailMessageOpen"
        }
      ]
    },
    "docs": {
      "homepageTrigger": {
        "runFunction": "onEditorsHomepage"
      },
      "onFileScopeGrantedTrigger": {
        "runFunction": "onFileScopeGrantedEditors"
      },
      "linkPreviewTriggers": [
        {
        "runFunction": "onLinkPreview",
        "patterns": [
            {
              "hostPattern": "example.com",
              "pathPrefix": "example-path"
            }
        ],
        "labelText": "Link preview",
        "localizedLabelText": {
          "es": "Link preview localized in Spanish"
        },
        "logoUrl": "https://www.example.com/images/smart-chip-icon.png"
        }
      ],
      "createActionTriggers": [
        {
          "id": "exampleId",
          "labelText": "Example label text",
          "localizedLabelText": {
            "es": "Label text localized in Spanish"
          },
          "runFunction": "exampleFunction",
          "logoUrl": "https://www.example.com/images/case.png"
        }
      ]
    },
    "sheets": {
      "homepageTrigger": {
        "runFunction": "onEditorsHomepage"
      },
      "onFileScopeGrantedTrigger": {
        "runFunction": "onFileScopeGrantedEditors"
      }
    },
    "slides": {
      "homepageTrigger": {
        "runFunction": "onEditorsHomepage"
      },
      "onFileScopeGrantedTrigger": {
        "runFunction": "onFileScopeGrantedEditors"
      }
    }
  },
  "oauthScopes": [
    "https://www.googleapis.com/auth/calendar.addons.execute",
    "https://www.googleapis.com/auth/calendar.addons.current.event.read",
    "https://www.googleapis.com/auth/calendar.addons.current.event.write",
    "https://www.googleapis.com/auth/drive.addons.metadata.readonly",
    "https://www.googleapis.com/auth/gmail.addons.current.action.compose",
    "https://www.googleapis.com/auth/gmail.addons.current.message.metadata",
    "https://www.googleapis.com/auth/userinfo.email",
    "https://www.googleapis.com/auth/script.external_request",
    "https://www.googleapis.com/auth/script.locale",
    "https://www.googleapis.com/auth/script.scriptapp",
    "https://www.googleapis.com/auth/drive.file",
    "https://www.googleapis.com/auth/documents.currentonly",
    "https://www.googleapis.com/auth/spreadsheets.currentonly",
    "https://www.googleapis.com/auth/presentations.currentonly",
    "https://www.googleapis.com/auth/workspace.linkpreview"
  ],
  "urlFetchWhitelist": [
    "https://www.example.com/myendpoint/"
  ]
}

HTTP

{
  "addOns": {
    "calendar": {
      "currentEventAccess": "READ_WRITE",
      "eventOpenTrigger": {
        "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onCalendarEventOpen"
      },
      "eventUpdateTrigger": {
        "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onCalendarEventUpdate"
      },
      "eventAttachmentTrigger": {
        "label": "My Event Attachment",
        "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onCalendarEventAddAttachment"
      },
      "homepageTrigger": {
        "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onCalendarHomePageOpen",
        "enabled": true
      }
    },
    "common": {
      "homepageTrigger": {
        "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onDefaultHomePageOpen",
        "enabled": true
      },
      "layoutProperties": {
        "primaryColor": "#ff392b",
        "secondaryColor": "#d68617"
      },
      "logoUrl": "https://ssl.gstatic.com/docs/script/images/logo/script-64.png",
      "name": "Demo Google Workspace Add-on",
      "openLinkUrlPrefixes": [
        "https://mail.google.com/",
        "https://script.google.com/a/google.com/d/",
        "https://drive.google.com/a/google.com/file/d/",
        "https://www.example.com/"
      ],
      "universalActions": [{
        "label": "Open settings",
        "runFunction": "https://myownpersonaldomain.com/mypage?trigger=getSettingsCard"
      }, {
        "label": "Open Help URL",
        "openLink": "https://www.example.com/help"
      }],
      "useLocaleFromApp": true
    },
    "drive": {
      "homepageTrigger": {
        "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onDriveHomePageOpen",
        "enabled": true
      },
      "onItemsSelectedTrigger": {
        "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onDriveItemsSelected"
      }
    },
    "gmail": {
      "composeTrigger": {
        "actions": [
          {
            "label": "Add images to email",
            "runFunction": "https://myownpersonaldomain.com/mypage?trigger=getInsertImageComposeCards"
          }
        ],
        "draftAccess": "METADATA"
      },
      "contextualTriggers": [
        {
          "unconditional": {},
          "onTriggerFunction": "https://myownpersonaldomain.com/mypage?trigger=onGmailMessageOpen"
        }
      ]
    },
    "docs": {
      "homepageTrigger": {
        "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onEditorsHomepage"
      },
      "onFileScopeGrantedTrigger": {
        "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onFileScopeGrantedEditors"
      },
      "linkPreviewTriggers": [
        {
          "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onLinkPreview",
          "patterns": [
              {
                "hostPattern": "example.com",
                "pathPrefix": "example-path"
              }
          ],
          "labelText": "Link preview",
          "localizedLabelText": {
            "es": "Link preview localized in Spanish"
          },
          "logoUrl": "https://www.example.com/images/smart-chip-icon.png"
        }
      ],
      "createActionTriggers": [
        {
          "id": "exampleId",
          "labelText": "Example label text",
          "localizedLabelText": {
            "es": "Label text localized in Spanish"
          },
          "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onCreateAction",
          "logoUrl": "https://www.example.com/images/case.png"
        }
      ]
    },
    "sheets": {
      "homepageTrigger": {
        "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onEditorsHomepage"
      },
      "onFileScopeGrantedTrigger": {
        "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onFileScopeGrantedEditors"
      }
    },
    "slides": {
      "homepageTrigger": {
        "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onEditorsHomepage"
      },
      "onFileScopeGrantedTrigger": {
        "runFunction": "https://myownpersonaldomain.com/mypage?trigger=onFileScopeGrantedEditors"
      }
    }
  },
  "oauthScopes": [
    "https://www.googleapis.com/auth/calendar.addons.execute",
    "https://www.googleapis.com/auth/calendar.addons.current.event.read",
    "https://www.googleapis.com/auth/calendar.addons.current.event.write",
    "https://www.googleapis.com/auth/drive.addons.metadata.readonly",
    "https://www.googleapis.com/auth/gmail.addons.current.action.compose",
    "https://www.googleapis.com/auth/gmail.addons.current.message.metadata",
    "https://www.googleapis.com/auth/userinfo.email",
    "https://www.googleapis.com/auth/script.external_request",
    "https://www.googleapis.com/auth/script.locale",
    "https://www.googleapis.com/auth/script.scriptapp",
    "https://www.googleapis.com/auth/drive.file",
    "https://www.googleapis.com/auth/documents.currentonly",
    "https://www.googleapis.com/auth/spreadsheets.currentonly",
    "https://www.googleapis.com/auth/presentations.currentonly",
    "https://www.googleapis.com/auth/workspace.linkpreview"
  ]
}

URL 허용 목록

허용 목록을 사용하여 액세스가 사전 승인된 특정 URL 지정 영향을 줄 수 있습니다. 허용 목록은 사용자 보호에 도움이 됩니다. data; 허용 목록을 정의하면 스크립트 프로젝트는 허용 목록에 추가되지 않았습니다.

이 필드는 테스트 배포를 설치할 때는 선택사항이지만 버전이 지정된 배포를 만듭니다

허용 목록은 스크립트 또는 부가기능이 실행될 때 다음 작업을 수행합니다.

  • 외부 위치 (예: HTTPS)에서 정보를 검색하거나 가져옵니다. 엔드포인트)를 사용하여 로그인(UrlFetch) 있습니다. URL 가져오기를 허용하려면 매니페스트 파일에 urlFetchWhitelist 필드를 포함합니다.
  • 사용자 작업에 대한 응답으로 URL을 열거나 표시합니다( Google Workspace 부가기능은 Google). URL 열기를 허용 목록에 추가하려면 addOns.common.openLinkUrlPrefixes 입력란을 매니페스트 파일을 참조하세요.
를 통해 개인정보처리방침을 정의할 수 있습니다.

허용 목록에 프리픽스 추가

매니페스트 파일에 허용 목록을 지정하는 경우( addOns.common.openLinkUrlPrefixes 또는 urlFetchWhitelist 필드)가 포함된 경우 URL 프리픽스 목록을 포함합니다. 매니페스트에 추가하는 접두어는 다음 요구사항을 충족해야 합니다.

  • 각 접두사는 유효한 URL이어야 합니다.
  • 각 프리픽스는 http://가 아닌 https://를 사용해야 합니다.
  • 각 프리픽스에는 전체 도메인이 있어야 합니다.
  • 각 프리픽스에는 비어 있지 않은 경로가 있어야 합니다. 예: https://www.google.com/ 은 유효하지만 https://www.google.com는 유효하지 않습니다.
  • 와일드 카드를 사용하여 URL 하위 도메인 프리픽스를 일치시킬 수 있습니다.
  • 단일 * 와일드 카드를 사용할 수 있습니다. addOns.common.openLinkUrlPrefixes 필드를 사용하여 모든 링크와 일치시킬 수 있지만 이 키워드는 사용자의 데이터가 위험에 처하게 되고 이로 인해 부가기능 검토 절차 단 부가기능 기능에 필요한 경우 와일드 카드를 사용하세요.

URL이 허용 목록에 있는 접두사와 일치하는지 확인할 때 다음 규칙은 적용:

  • 경로 일치는 대소문자를 구분합니다.
  • 접두사가 URL과 동일하면 매칭입니다.
  • URL이 접두사의 하위 값과 같거나 하위에 있으면 일치입니다.

예를 들어 프리픽스 https://example.com/foo는 다음 URL과 일치합니다.

  • https://example.com/foo
  • https://example.com/foo/
  • https://example.com/foo/bar
  • https://example.com/foo?bar
  • https://example.com/foo#bar

와일드 카드 사용

단일 와일드 카드 문자 (*)를 사용하여 urlFetchWhitelistaddOns.common.openLinkUrlPrefixes 있습니다. 여러 하위 도메인과 일치시키기 위해 두 개 이상의 와일드 카드를 사용할 수 없습니다. 와일드 카드는 URL의 선행 접두어를 나타내야 합니다.

예를 들어 접두사 https://*.example.com/foo는 다음과 일치합니다. URL:

  • https://subdomain.example.com/foo
  • https://any.number.of.subdomains.example.com/foo

접두사 https://*.example.com/foo은 다음과 일치하지 않습니다. URL:

  • https://subdomain.example.com/bar (접미사 불일치)
  • https://example.com/foo (하위 도메인이 하나 이상 있어야 함)

일부 접두사 규칙은 매니페스트를 저장하려고 할 때 적용됩니다. 대상 예를 들어 다음 접두사가 매니페스트 파일을 저장합니다.

  • https://*.*.example.com/foo (여러 개의 와일드 카드는 금지됨)
  • https://subdomain.*.example.com/foo (와일드 카드를 선행 접두사로 사용해야 함)