Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit 575ec24

Browse files
committed
Add Token marker type
This will make it simpler for us to identify which fields are sensitive by type, rather than by field name.
1 parent 23e1666 commit 575ec24

File tree

12 files changed

+32
-10
lines changed

12 files changed

+32
-10
lines changed

lib/axiom/types/token.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Axiom::Types::Token < Axiom::Types::String
2+
def self.infer(object)
3+
if object == Axiom::Types::Token
4+
self
5+
end
6+
end
7+
end

lib/cc/service.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class Service
66
require "cc/service/formatter"
77
require "cc/service/invocation"
88
require "axiom/types/password"
9+
require "axiom/types/token"
910

1011
dir = File.expand_path "../helpers", __FILE__
1112
Dir["#{dir}/*_helper.rb"].sort.each do |helper|

lib/cc/services/asana.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class CC::Service::Asana < CC::Service
22
class Config < CC::Service::Config
3-
attribute :personal_access_token, Axiom::Types::String, label: "Personal Access Token"
4-
attribute :api_key, Axiom::Types::String, label: "API key (Deprecated)"
3+
attribute :personal_access_token, Axiom::Types::Token, label: "Personal Access Token"
4+
attribute :api_key, Axiom::Types::Token, label: "API key (Deprecated)"
55

66
attribute :workspace_id, Axiom::Types::String, label: "Workspace ID"
77

lib/cc/services/campfire.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class CC::Service::Campfire < CC::Service
22
class Config < CC::Service::Config
33
attribute :subdomain, Axiom::Types::String,
44
description: "The Campfire subdomain for the account"
5-
attribute :token, Axiom::Types::String,
5+
attribute :token, Axiom::Types::Token,
66
description: "Your Campfire API auth token"
77
attribute :room_id, Axiom::Types::String,
88
description: "Check your campfire URL for a room ID. Usually 6 digits."

lib/cc/services/flowdock.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class CC::Service::Flowdock < CC::Service
22
class Config < CC::Service::Config
3-
attribute :api_token, Axiom::Types::String,
3+
attribute :api_token, Axiom::Types::Token,
44
label: "API Token",
55
description: "The API token of the Flow to send notifications to",
66
link: "https://www.flowdock.com/account/tokens"

lib/cc/services/github_issues.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class CC::Service::GitHubIssues < CC::Service
22
class Config < CC::Service::Config
3-
attribute :oauth_token, Axiom::Types::String,
3+
attribute :oauth_token, Axiom::Types::Token,
44
label: "OAuth Token",
55
description: "A personal OAuth token with permissions for the repo"
66
attribute :project, Axiom::Types::String,

lib/cc/services/github_pull_requests.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class CC::Service::GitHubPullRequests < CC::PullRequests
44
class Config < CC::Service::Config
5-
attribute :oauth_token, Axiom::Types::String,
5+
attribute :oauth_token, Axiom::Types::Token,
66
label: "OAuth Token",
77
description: "A personal OAuth token with permissions for the repo."
88
attribute :base_url, Axiom::Types::String,

lib/cc/services/gitlab_merge_requests.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class CC::Service::GitlabMergeRequests < CC::PullRequests
44
class Config < CC::Service::Config
55
CONTEXT = "codeclimate".freeze
66

7-
attribute :access_token, Axiom::Types::String,
7+
attribute :access_token, Axiom::Types::Token,
88
label: "Access Token",
99
description: "A personal access token with permissions for the repo."
1010
attribute :base_url, Axiom::Types::String,

lib/cc/services/hipchat.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class CC::Service::HipChat < CC::Service
22
class Config < CC::Service::Config
3-
attribute :auth_token, Axiom::Types::String,
3+
attribute :auth_token, Axiom::Types::Token,
44
description: "Your HipChat API auth token"
55

66
attribute :room_id, Axiom::Types::String,

lib/cc/services/lighthouse.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class Config < CC::Service::Config
33
attribute :subdomain, Axiom::Types::String,
44
description: "Your Lighthouse subdomain"
55

6-
attribute :api_token, Axiom::Types::String,
6+
attribute :api_token, Axiom::Types::Token,
77
label: "API Token",
88
description: "Your Lighthouse API Key (http://help.lighthouseapp.com/kb/api/how-do-i-get-an-api-token)"
99

0 commit comments

Comments
 (0)