Welcome to mirror list, hosted at ThFree Co, Russian Federation.

constants.js « commit « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e28009ab99699506382fa2e91feea2f560a2f567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import { __, s__ } from '~/locale';

export const X509_CERTIFICATE_KEY_IDENTIFIER_TITLE = __('Subject Key Identifier:');

export const verificationStatuses = {
  VERIFIED: 'VERIFIED',
  UNVERIFIED: 'UNVERIFIED',
  UNVERIFIED_KEY: 'UNVERIFIED_KEY',
  UNKNOWN_KEY: 'UNKNOWN_KEY',
  OTHER_USER: 'OTHER_USER',
  SAME_USER_DIFFERENT_EMAIL: 'SAME_USER_DIFFERENT_EMAIL',
  MULTIPLE_SIGNATURES: 'MULTIPLE_SIGNATURES',
  REVOKED_KEY: 'REVOKED_KEY',
};

export const signatureTypes = {
  /* eslint-disable @gitlab/require-i18n-strings */
  GPG: 'GpgSignature',
  X509: 'X509Signature',
  SSH: 'SshSignature',
  /* eslint-enable @gitlab/require-i18n-strings */
};

const UNVERIFIED_CONFIG = {
  variant: 'muted',
  label: __('Unverified'),
  title: __('Unverified signature'),
  description: __('This commit was signed with an unverified signature.'),
};

export const statusConfig = {
  [verificationStatuses.VERIFIED]: {
    variant: 'success',
    label: __('Verified'),
    title: __('Verified commit'),
    description: __(
      'This commit was signed with a verified signature and the committer email was verified to belong to the same user.',
    ),
  },
  [verificationStatuses.UNVERIFIED]: {
    ...UNVERIFIED_CONFIG,
  },
  [verificationStatuses.UNVERIFIED_KEY]: {
    ...UNVERIFIED_CONFIG,
  },
  [verificationStatuses.UNKNOWN_KEY]: {
    ...UNVERIFIED_CONFIG,
  },
  [verificationStatuses.OTHER_USER]: {
    variant: 'muted',
    label: __('Unverified'),
    title: __("Different user's signature"),
    description: __('This commit was signed with an unverified signature.'),
  },
  [verificationStatuses.SAME_USER_DIFFERENT_EMAIL]: {
    variant: 'muted',
    label: __('Unverified'),
    title: __('GPG key mismatch'),
    description: __(
      'This commit was signed with a verified signature, but the committer email is not associated with the GPG Key.',
    ),
  },
  [verificationStatuses.MULTIPLE_SIGNATURES]: {
    variant: 'muted',
    label: __('Unverified'),
    title: __('Multiple signatures'),
    description: __('This commit was signed with multiple signatures.'),
  },
  [verificationStatuses.REVOKED_KEY]: {
    variant: 'muted',
    label: __('Unverified'),
    title: s__('CommitSignature|Unverified signature'),
    description: s__('CommitSignature|This commit was signed with a key that was revoked.'),
  },
};

export const typeConfig = {
  [signatureTypes.GPG]: {
    keyLabel: __('GPG Key ID:'),
    keyNamespace: 'gpgKeyPrimaryKeyid',
    helpLink: {
      label: __('Learn about signing commits'),
      path: 'user/project/repository/signed_commits/index.md',
    },
  },
  [signatureTypes.X509]: {
    keyLabel: '',
    helpLink: {
      label: __('Learn more about X.509 signed commits'),
      path: '/user/project/repository/signed_commits/x509.md',
    },
    subjectTitle: __('Certificate Subject'),
    issuerTitle: __('Certificate Issuer'),
    keyIdentifierTitle: __('Subject Key Identifier:'),
  },
  [signatureTypes.SSH]: {
    keyLabel: __('SSH key fingerprint:'),
    keyNamespace: 'keyFingerprintSha256',
    helpLink: {
      label: __('Learn about signing commits with SSH keys.'),
      path: '/user/project/repository/signed_commits/ssh.md',
    },
  },
};