github.com/minio/minio@v0.0.0-20240328213742-3f72439b8a27/internal/config/lambda/event/event.go (about) 1 // Copyright (c) 2015-2023 MinIO, Inc. 2 // 3 // This file is part of MinIO Object Storage stack 4 // 5 // This program is free software: you can redistribute it and/or modify 6 // it under the terms of the GNU Affero General Public License as published by 7 // the Free Software Foundation, either version 3 of the License, or 8 // (at your option) any later version. 9 // 10 // This program is distributed in the hope that it will be useful 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU Affero General Public License for more details. 14 // 15 // You should have received a copy of the GNU Affero General Public License 16 // along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18 package event 19 20 import "net/http" 21 22 // Identity represents access key who caused the event. 23 type Identity struct { 24 Type string `json:"type"` 25 PrincipalID string `json:"principalId"` 26 AccessKeyID string `json:"accessKeyId"` 27 } 28 29 // UserRequest user request headers 30 type UserRequest struct { 31 URL string `json:"url"` 32 Headers http.Header `json:"headers"` 33 } 34 35 // GetObjectContext provides the necessary details to perform 36 // download of the object, and return back the processed response 37 // to the server. 38 type GetObjectContext struct { 39 OutputRoute string `json:"outputRoute"` 40 OutputToken string `json:"outputToken"` 41 InputS3URL string `json:"inputS3Url"` 42 } 43 44 // Event represents lambda function event, this is undocumented in AWS S3. This 45 // structure bases itself on this structure but there is no binding. 46 // 47 // { 48 // "xAmzRequestId": "a2871150-1df5-4dc9-ad9f-3da283ca1bf3", 49 // "getObjectContext": { 50 // "outputRoute": "...", 51 // "outputToken": "...", 52 // "inputS3Url": "<presignedURL>" 53 // }, 54 // "configuration": { // not useful in MinIO 55 // "accessPointArn": "...", 56 // "supportingAccessPointArn": "...", 57 // "payload": "" 58 // }, 59 // "userRequest": { 60 // "url": "...", 61 // "headers": { 62 // "Host": "...", 63 // "X-Amz-Content-SHA256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" 64 // } 65 // }, 66 // "userIdentity": { 67 // "type": "IAMUser", 68 // "principalId": "AIDAJF5MO57RFXQCE5ZNC", 69 // "arn": "...", 70 // "accountId": "...", 71 // "accessKeyId": "AKIA3WNQJCXE2DYPAU7R" 72 // }, 73 // "protocolVersion": "1.00" 74 // } 75 type Event struct { 76 ProtocolVersion string `json:"protocolVersion"` 77 GetObjectContext *GetObjectContext `json:"getObjectContext"` 78 UserIdentity Identity `json:"userIdentity"` 79 UserRequest UserRequest `json:"userRequest"` 80 }