Module: Vaml::Github
- Defined in:
- lib/vaml/github.rb
Class Method Summary collapse
- .auth(token) ⇒ Object
- .enable_auth(org = Vaml.configuration.organization) ⇒ Object
- .grant_policy(team_name, policy_name) ⇒ Object
Class Method Details
.auth(token) ⇒ Object
14 15 16 17 |
# File 'lib/vaml/github.rb', line 14 def self.auth(token) puts "Authenticating to Github ... " Vault.auth.github(token) end |
.enable_auth(org = Vaml.configuration.organization) ⇒ Object
3 4 5 6 7 |
# File 'lib/vaml/github.rb', line 3 def self.enable_auth(org = Vaml.configuration.organization) puts "Enabling auth for #{org} ... " Vault.sys.enable_auth("github", "github") unless Vault.sys.auths[:github] Vault.logical.write("auth/github/config", organization: org) end |
.grant_policy(team_name, policy_name) ⇒ Object
9 10 11 12 |
# File 'lib/vaml/github.rb', line 9 def self.grant_policy(team_name, policy_name) puts "Granting policy for #{team_name} ... #{policy_name} " Vaml.write_string("auth/github/map/teams/#{team_name}", policy_name) end |