akkounts/app/services/ldap_manager/update_nostr_key.rb
Râu Cao 5a3adba603
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Release Drafter / Update release notes draft (pull_request) Successful in 4s
Move nostr pubkeys to LDAP attribute
closes #173
2024-03-17 11:04:11 +01:00

17 lines
311 B
Ruby

module LdapManager
class UpdateNostrKey < LdapManagerService
def initialize(dn:, pubkey:)
@dn = dn
@pubkey = pubkey
end
def call
if @pubkey.present?
replace_attribute @dn, :nostrKey, @pubkey
else
delete_attribute @dn, :nostrKey
end
end
end
end