github.com/akamai/AkamaiOPEN-edgegrid-golang/v2@v2.17.0/pkg/appsec/appsec.go (about) 1 // Package appsec provides access to the Akamai Application Security APIs 2 package appsec 3 4 import ( 5 "errors" 6 7 "github.com/akamai/AkamaiOPEN-edgegrid-golang/v2/pkg/session" 8 ) 9 10 var ( 11 // ErrStructValidation is returned returned when given struct validation failed 12 ErrStructValidation = errors.New("struct validation") 13 ) 14 15 type ( 16 // APPSEC is the appsec api interface 17 APPSEC interface { 18 Activations 19 AdvancedSettingsEvasivePathMatch 20 AdvancedSettingsLogging 21 AdvancedSettingsPragma 22 AdvancedSettingsPrefetch 23 ApiConstraintsProtection 24 ApiEndpoints 25 ApiHostnameCoverage 26 ApiHostnameCoverageMatchTargets 27 ApiHostnameCoverageOverlapping 28 ApiRequestConstraints 29 AttackGroup 30 BypassNetworkLists 31 Configuration 32 ConfigurationClone 33 ConfigurationVersion 34 ConfigurationVersionClone 35 ContractsGroups 36 CustomDeny 37 CustomRule 38 CustomRuleAction 39 Eval 40 EvalGroup 41 EvalHost 42 EvalPenaltyBox 43 EvalProtectHost 44 EvalRule 45 ExportConfiguration 46 FailoverHostnames 47 IPGeo 48 IPGeoProtection 49 MalwareContentTypes 50 MalwarePolicy 51 MalwarePolicyAction 52 MalwareProtection 53 MatchTarget 54 MatchTargetSequence 55 NetworkLayerProtection 56 PenaltyBox 57 PolicyProtections 58 RatePolicy 59 RatePolicyAction 60 RateProtection 61 ReputationAnalysis 62 ReputationProfile 63 ReputationProfileAction 64 ReputationProtection 65 Rule 66 RuleUpgrade 67 SecurityPolicy 68 SecurityPolicyClone 69 SelectableHostnames 70 SelectedHostname 71 SiemDefinitions 72 SiemSettings 73 SlowPostProtection 74 SlowPostProtectionSetting 75 ThreatIntel 76 TuningRecommendations 77 VersionNotes 78 WAFMode 79 WAFProtection 80 WAPBypassNetworkLists 81 WAPSelectedHostnames 82 } 83 84 appsec struct { 85 session.Session 86 } 87 88 // Option defines a PAPI option 89 Option func(*appsec) 90 91 // ClientFunc is a appsec client new method, this can used for mocking 92 ClientFunc func(sess session.Session, opts ...Option) APPSEC 93 ) 94 95 // Client returns a new appsec Client instance with the specified controller 96 func Client(sess session.Session, opts ...Option) APPSEC { 97 p := &appsec{ 98 Session: sess, 99 } 100 101 for _, opt := range opts { 102 opt(p) 103 } 104 return p 105 }