Skip to content

Commit

Permalink
Update credit
Browse files Browse the repository at this point in the history
  • Loading branch information
spiegel-im-spiegel committed Sep 27, 2022
1 parent 5d8e694 commit a3db900
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 174 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Importing CVSS vector and scoring.

- Supoort CVSS version 3.0 and 3.1
- Supoort CVSS v2, v3.0 and v3.1
- Exporting CVSS information with template string

**Migrated repository to [github.com/goark/go-cvss][go-cvss]**
Expand Down
15 changes: 1 addition & 14 deletions v2/base/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,4 @@ func (m *Metrics) TemporalScore() float64 {
return math.Round(m.Score()*m.E.Value()*m.RL.Value()*m.RC.Value()*10) / 10
}

/* Copyright 2018-2020 Spiegel
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Copyright 2022 luxifer */
2 changes: 2 additions & 0 deletions v2/base/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,3 +438,5 @@ func TestDecode(t *testing.T) {
})
}
}

/* Copyright 2022 luxifer */
25 changes: 6 additions & 19 deletions v2/base/metric-a.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package base

import "strings"

//AvailabilityImpact is metric type for Base Metrics
// AvailabilityImpact is metric type for Base Metrics
type AvailabilityImpact int

//Constant of AvailabilityImpact result
// Constant of AvailabilityImpact result
const (
AvailabilityImpactUnknown AvailabilityImpact = iota
AvailabilityImpactNone
Expand All @@ -25,7 +25,7 @@ var availabilityImpactValueMap = map[AvailabilityImpact]float64{
AvailabilityImpactComplete: 0.66,
}

//GetAvailabilityImpact returns result of AvailabilityImpact metric
// GetAvailabilityImpact returns result of AvailabilityImpact metric
func GetAvailabilityImpact(s string) AvailabilityImpact {
s = strings.ToUpper(s)
for k, v := range availabilityImpactMap {
Expand All @@ -43,30 +43,17 @@ func (ai AvailabilityImpact) String() string {
return ""
}

//Value returns value of AvailabilityImpact metric
// Value returns value of AvailabilityImpact metric
func (ai AvailabilityImpact) Value() float64 {
if v, ok := availabilityImpactValueMap[ai]; ok {
return v
}
return 0.0
}

//IsDefined returns false if undefined result value of metric
// IsDefined returns false if undefined result value of metric
func (ai AvailabilityImpact) IsDefined() bool {
return ai != AvailabilityImpactUnknown
}

/* Copyright 2018 Spiegel
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Copyright 2022 luxifer */
25 changes: 6 additions & 19 deletions v2/base/metric-ac.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package base

import "strings"

//AccessComplexity is metric type for Base Metrics
// AccessComplexity is metric type for Base Metrics
type AccessComplexity int

//Constant of AccessComplexity result
// Constant of AccessComplexity result
const (
AccessComplexityUnknown AccessComplexity = iota
AccessComplexityHigh
Expand All @@ -25,7 +25,7 @@ var accessComplexityValueMap = map[AccessComplexity]float64{
AccessComplexityLow: 0.71,
}

//GetAccessComplexity returns result of AccessComplexity metric
// GetAccessComplexity returns result of AccessComplexity metric
func GetAccessComplexity(s string) AccessComplexity {
s = strings.ToUpper(s)
for k, v := range accessComplexityMap {
Expand All @@ -43,30 +43,17 @@ func (ac AccessComplexity) String() string {
return ""
}

//Value returns value of AccessComplexity metric
// Value returns value of AccessComplexity metric
func (ac AccessComplexity) Value() float64 {
if v, ok := accessComplexityValueMap[ac]; ok {
return v
}
return 0.0
}

//IsDefined returns false if undefined result value of metric
// IsDefined returns false if undefined result value of metric
func (ac AccessComplexity) IsDefined() bool {
return ac != AccessComplexityUnknown
}

/* Copyright 2018 Spiegel
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Copyright 2022 luxifer */
25 changes: 6 additions & 19 deletions v2/base/metric-au.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package base

import "strings"

//Authentication is metric type for Base Metrics
// Authentication is metric type for Base Metrics
type Authentication int

//Constant of Authentication result
// Constant of Authentication result
const (
AuthenticationUnknown Authentication = iota
AuthenticationNone
Expand All @@ -25,7 +25,7 @@ var authenticationValueMap = map[Authentication]float64{
AuthenticationMultiple: 0.45,
}

//GetAuthentication returns result of Authentication metric
// GetAuthentication returns result of Authentication metric
func GetAuthentication(s string) Authentication {
s = strings.ToUpper(s)
for k, v := range authenticationMap {
Expand All @@ -43,30 +43,17 @@ func (av Authentication) String() string {
return ""
}

//Value returns value of Authentication metric
// Value returns value of Authentication metric
func (av Authentication) Value() float64 {
if v, ok := authenticationValueMap[av]; ok {
return v
}
return 0.0
}

//IsDefined returns false if undefined result value of metric
// IsDefined returns false if undefined result value of metric
func (av Authentication) IsDefined() bool {
return av != AuthenticationUnknown
}

/* Copyright 2018 Spiegel
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Copyright 2022 luxifer */
25 changes: 6 additions & 19 deletions v2/base/metric-av.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package base

import "strings"

//AccessVector is metric type for Base Metrics
// AccessVector is metric type for Base Metrics
type AccessVector int

//Constant of AccessVector result
// Constant of AccessVector result
const (
AccessVectorUnknown AccessVector = iota
AccessVectorLocal
Expand All @@ -25,7 +25,7 @@ var accessVectorValueMap = map[AccessVector]float64{
AccessVectorNetwork: 1,
}

//GetAccessVector returns result of AccessVector metric
// GetAccessVector returns result of AccessVector metric
func GetAccessVector(s string) AccessVector {
s = strings.ToUpper(s)
for k, v := range accessVectorMap {
Expand All @@ -43,30 +43,17 @@ func (av AccessVector) String() string {
return ""
}

//Value returns value of AccessVector metric
// Value returns value of AccessVector metric
func (av AccessVector) Value() float64 {
if v, ok := accessVectorValueMap[av]; ok {
return v
}
return 0.0
}

//IsDefined returns false if undefined result value of metric
// IsDefined returns false if undefined result value of metric
func (av AccessVector) IsDefined() bool {
return av != AccessVectorUnknown
}

/* Copyright 2018 Spiegel
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Copyright 2022 luxifer */
25 changes: 6 additions & 19 deletions v2/base/metric-c.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package base

import "strings"

//ConfidentialityImpact is metric type for Base Metrics
// ConfidentialityImpact is metric type for Base Metrics
type ConfidentialityImpact int

//Constant of ConfidentialityImpact result
// Constant of ConfidentialityImpact result
const (
ConfidentialityImpactUnknown ConfidentialityImpact = iota
ConfidentialityImpactNone
Expand All @@ -25,7 +25,7 @@ var confidentialityImpactValueMap = map[ConfidentialityImpact]float64{
ConfidentialityImpactComplete: 0.66,
}

//GetConfidentialityImpact returns result of ConfidentialityImpact metric
// GetConfidentialityImpact returns result of ConfidentialityImpact metric
func GetConfidentialityImpact(s string) ConfidentialityImpact {
s = strings.ToUpper(s)
for k, v := range confidentialityImpactMap {
Expand All @@ -43,30 +43,17 @@ func (ci ConfidentialityImpact) String() string {
return ""
}

//Value returns value of ConfidentialityImpact metric
// Value returns value of ConfidentialityImpact metric
func (ci ConfidentialityImpact) Value() float64 {
if v, ok := confidentialityImpactValueMap[ci]; ok {
return v
}
return 0.0
}

//IsDefined returns false if undefined result value of metric
// IsDefined returns false if undefined result value of metric
func (ci ConfidentialityImpact) IsDefined() bool {
return ci != ConfidentialityImpactUnknown
}

/* Copyright 2018 Spiegel
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Copyright 2022 luxifer */
25 changes: 6 additions & 19 deletions v2/base/metric-i.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package base

import "strings"

//IntegrityImpact is metric type for Base Metrics
// IntegrityImpact is metric type for Base Metrics
type IntegrityImpact int

//Constant of IntegrityImpact result
// Constant of IntegrityImpact result
const (
IntegrityImpactUnknown IntegrityImpact = iota
IntegrityImpactNone
Expand All @@ -25,7 +25,7 @@ var integrityImpactValueMap = map[IntegrityImpact]float64{
IntegrityImpactComplete: 0.66,
}

//GetIntegrityImpact returns result of IntegrityImpact metric
// GetIntegrityImpact returns result of IntegrityImpact metric
func GetIntegrityImpact(s string) IntegrityImpact {
s = strings.ToUpper(s)
for k, v := range integrityImpactMap {
Expand All @@ -43,30 +43,17 @@ func (ii IntegrityImpact) String() string {
return ""
}

//Value returns value of IntegrityImpact metric
// Value returns value of IntegrityImpact metric
func (ii IntegrityImpact) Value() float64 {
if v, ok := integrityImpactValueMap[ii]; ok {
return v
}
return 0.0
}

//IsDefined returns false if undefined result value of metric
// IsDefined returns false if undefined result value of metric
func (ii IntegrityImpact) IsDefined() bool {
return ii != IntegrityImpactUnknown
}

/* Copyright 2018 Spiegel
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Copyright 2022 luxifer */
Loading

0 comments on commit a3db900

Please sign in to comment.