Skip to content

Commit

Permalink
Merge branch 'master' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
Johaney-s committed Jan 17, 2022
2 parents c91c5ce + db46074 commit 13ba1cc
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2010-2021, CESNET, CERIT-SC, Masaryk University. All rights reserved.
Copyright (c) 2010-2022, CESNET, CERIT-SC, Masaryk University. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Pre scripts are processed before slave script and post scripts are processed aft

> Our work is FreeBSD license, yet we sometimes use components under different licenses (e.g. Apache, GNU, CC).
© 2010-2021 [CESNET](https://www.cesnet.cz/?lang=en), [CERIT-SC](https://www.cerit-sc.cz/en/index.html) and [Masaryk University](https://www.muni.cz/en), all rights reserved.
© 2010-2022 [CESNET](https://www.cesnet.cz/?lang=en), [CERIT-SC](https://www.cerit-sc.cz/en/index.html) and [Masaryk University](https://www.muni.cz/en), all rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Expand Down
4 changes: 3 additions & 1 deletion gen/ad_group_mu_ucn
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use strict;
use warnings;
use perunServicesInit;
use perunServicesUtils;
use MIME::Base64;
use Encode;
no if $] >= 5.017011, warnings => 'experimental::smartmatch';

local $::SERVICE_NAME = "ad_group_mu_ucn";
Expand Down Expand Up @@ -101,7 +103,7 @@ for my $group (sort keys %$groups) {
print FILE "dn: CN=" . $group . "," . $groups->{$group}->{$A_R_ADOUNAME} . "\n";
print FILE "cn: " . $group . "\n";
print FILE "samAccountName: " . $group . "\n";
print FILE "description: " . $groups->{$group}->{"description"} . "\n";
print FILE "description:: " . encode_base64($groups->{$group}->{"description"}) . "\n";
print FILE "info: perun\@muni.cz\n";
print FILE "objectClass: group\n";
print FILE "objectClass: top\n";
Expand Down
7 changes: 4 additions & 3 deletions gen/ldap_it4i
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ our $A_USER_LOGIN_EINFRA; *A_USER_LOGIN_EINFRA = \'urn:perun:user:attribute-def:
our $A_FIRST_NAME; *A_FIRST_NAME = \'urn:perun:user:attribute-def:core:firstName';
our $A_LAST_NAME; *A_LAST_NAME = \'urn:perun:user:attribute-def:core:lastName';
our $A_DISPLAY_NAME; *A_DISPLAY_NAME = \'urn:perun:user:attribute-def:core:displayName';
our $A_USER_PREFERRED_MAIL; *A_USER_PREFERRED_MAIL = \'urn:perun:user:attribute-def:def:preferredMail';
our $A_SSHKEYS; *A_SSHKEYS = \'urn:perun:user:attribute-def:def:sshPublicKey';
our $A_MEMBER_STATUS; *A_MEMBER_STATUS = \'urn:perun:member:attribute-def:core:status';
our $A_USER_PREFERRED_MAIL; *A_USER_PREFERRED_MAIL = \'urn:perun:user:attribute-def:def:preferredMail';
our $A_MEMBER_MAIL; *A_MEMBER_MAIL = \'urn:perun:member:attribute-def:def:mail';

our $STATUS_VALID; *STATUS_VALID = \'VALID';
our $STATUS_EXPIRED; *STATUS_EXPIRED = \'EXPIRED';
Expand All @@ -46,7 +47,7 @@ foreach my $resourceId ( $data->getResourceIds() ) {
$users->{$login}->{$A_FIRST_NAME} = $data->getUserAttributeValue( member => $memberId, attrName => $A_FIRST_NAME );
$users->{$login}->{$A_LAST_NAME} = $data->getUserAttributeValue( member => $memberId, attrName => $A_LAST_NAME );
$users->{$login}->{$A_DISPLAY_NAME} = $data->getUserAttributeValue( member => $memberId, attrName => $A_DISPLAY_NAME );
$users->{$login}->{$A_USER_PREFERRED_MAIL} = $data->getUserAttributeValue( member => $memberId, attrName => $A_USER_PREFERRED_MAIL );
$users->{$login}->{$A_MEMBER_MAIL} = $data->getMemberAttributeValue( member => $memberId, attrName => $A_MEMBER_MAIL ) || $data->getUserAttributeValue( member => $memberId, attrName => $A_USER_PREFERRED_MAIL );
$users->{$login}->{$A_SSHKEYS} = $data->getUserAttributeValue( member => $memberId, attrName => $A_SSHKEYS );

my $status = $data->getMemberAttributeValue( member => $memberId, attrName => $A_MEMBER_STATUS );
Expand Down Expand Up @@ -96,7 +97,7 @@ for my $login (sort keys %$users) {
}

print FILE "displayName: " . $users->{$login}->{$A_DISPLAY_NAME} . "\n";
print FILE "mail: " . $users->{$login}->{$A_USER_PREFERRED_MAIL} . "\n";
print FILE "mail: " . $users->{$login}->{$A_MEMBER_MAIL} . "\n";
print FILE "userPassword: {SASL}" . $login . '@EINFRA' . "\n";
print FILE "status: " . $users->{$login}->{$A_MEMBER_STATUS} . "\n";

Expand Down
12 changes: 6 additions & 6 deletions send/ldap_it4i
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ldap_bind($ldap, $conf[1], $conf[2]);

# load all data
my @users = load_perun($service_file);
my @previousUsers = load_ad($ldap, $base_dn, $filter, ['uid','givenName','sn','cn','displayName','mail','status','sshPublicKey']);
my @previousUsers = load_ad($ldap, $base_dn, $filter, ['uid','givenName','sn','cn','displayName','mail','status','sshPublicKey','userPassword']);

my %previousUsersMap = ();
foreach my $previousUser (@previousUsers) {
Expand Down Expand Up @@ -94,22 +94,22 @@ sub process_update() {

my $previousUser = $previousUsersMap{$user->get_value('uid')};

my @attrs = ('givenName','sn','cn','displayName','mail','status','sshPublicKey');
my @attrs = ('givenName','sn','cn','displayName','mail','status','sshPublicKey','userPassword');

# stored log messages to check if entry should be updated
my @entry_changed = ();

# check each attribute
foreach my $attr (@attrs) {
if (compare_entry( $previousUser, $user, $attr ) == 1) {
my $entry = $previousUser->get_value($attr);
my $perun_entry = $user->get_value($attr);
my @entry = $previousUser->get_value($attr);
my @perun_entry = $user->get_value($attr);

push(@entry_changed,
"$attr | " . join(", ", $entry) . " => " . join(", ", $perun_entry));
"$attr | " . join(", ", @entry) . " => " . join(", ", @perun_entry));
# replace value
$previousUser->replace(
$attr => \$perun_entry
$attr => \@perun_entry
);
}
}
Expand Down
6 changes: 6 additions & 0 deletions slave/meta/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
perun-slave-full (3.1.15) stable; urgency=medium

* added new service vmware-ldap

-- Martin Kuba <[email protected]> Thu, 16 Dec 2021 15:50:37 +0100

perun-slave-full (3.1.14) stable; urgency=medium

* removed unused service openvpn
Expand Down
2 changes: 1 addition & 1 deletion slave/process-vmware-ldap/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
perun-slave-process-vmware-ldap (1.0.0) stable; urgency=low

* New service for provisioning of LDAP for VMware.
* New service for provisioning of LDAP for VMware.

-- Pavel Zlamal <[email protected]> Tue, 14 Dec 2021 10:40:00 +0100

0 comments on commit 13ba1cc

Please sign in to comment.