Skip to content

Commit

Permalink
put
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinDelille committed Aug 27, 2022
1 parent 9df984a commit 2bf4ffd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions renew.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ def create_box(public_key)
repo = client.repo 'atelierdesmedias/atelierdesmedias.github.io'

secret = { name: 'BOBO', value: 'bonbon' }
box = create_box(client.get_public_key(repo.id))
public_key = client.get_public_key(repo.id)
puts 'public key:', public_key, public_key[:key], public_key[:key_id]
box = create_box(public_key)
puts 'box:', box[:key_id], box[:box]
puts 'after'
encrypted = box[:box].encrypt(secret[:value])
encrypted_value = Base64.strict_encode64(encrypted)
puts 'encrypted_value:', encrypted_value
puts client.create_or_update_secret(
repo.id, secret[:name],
key_id: box[:key_id], encrypted_value: Base64.strict_encode64(encrypted)
key_id: box[:key_id], encrypted_value: encrypted_value
)
puts client.last_response.status

0 comments on commit 2bf4ffd

Please sign in to comment.