Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eduGAIN Access Check - Account manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edugain
eduGAIN Access Check - Account manager
Commits
5c185edc
Commit
5c185edc
authored
6 years ago
by
Guillaume ROUSSE
Browse files
Options
Downloads
Patches
Plain Diff
rename token attribute from 'token' to 'secret'
parent
aed5719e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/AccountManager/App.pm
+11
-11
11 additions, 11 deletions
lib/AccountManager/App.pm
lib/AccountManager/Token.pm
+3
-3
3 additions, 3 deletions
lib/AccountManager/Token.pm
with
14 additions
and
14 deletions
lib/AccountManager/App.pm
+
11
−
11
View file @
5c185edc
...
@@ -454,7 +454,7 @@ sub req_complete_challenge {
...
@@ -454,7 +454,7 @@ sub req_complete_challenge {
sp_entityid
=>
$entityid
,
sp_entityid
=>
$entityid
,
creation_date
=>
DateTime
->
now
(),
creation_date
=>
DateTime
->
now
(),
expiration_date
=>
DateTime
->
now
()
->
add
(
hours
=>
$validity_period
),
expiration_date
=>
DateTime
->
now
()
->
add
(
hours
=>
$validity_period
),
token
=>
AccountManager::Tools::
generate_secret
(
20
)
secret
=>
AccountManager::Tools::
generate_secret
(
20
)
);
);
$self
->
abort
(
$self
->
abort
(
...
@@ -477,7 +477,7 @@ sub req_complete_challenge {
...
@@ -477,7 +477,7 @@ sub req_complete_challenge {
sourceip
=>
$ENV
{
REMOTE_ADDR
},
sourceip
=>
$ENV
{
REMOTE_ADDR
},
to
=>
$email
,
to
=>
$email
,
entityid
=>
$entityid
,
entityid
=>
$entityid
,
token
=>
$token
->
token
(),
token
=>
$token
->
secret
(),
challenge_url
=>
sprintf
(
challenge_url
=>
sprintf
(
'
%s&action=complete_challenge&federation=%s&entity=%s&email=%s
',
'
%s&action=complete_challenge&federation=%s&entity=%s&email=%s
',
$self
->
{
configuration
}
->
{
app
}
->
{
url
},
$self
->
{
configuration
}
->
{
app
}
->
{
url
},
...
@@ -535,7 +535,7 @@ sub req_complete_challenge {
...
@@ -535,7 +535,7 @@ sub req_complete_challenge {
"
Token send to %s for entityid=%s;token=%s
",
"
Token send to %s for entityid=%s;token=%s
",
$email
,
$email
,
$entityid
,
$entityid
,
$token
->
token
(),
$token
->
secret
(),
);
);
$self
->
respond
(
$self
->
respond
(
...
@@ -575,8 +575,8 @@ sub req_create_accounts {
...
@@ -575,8 +575,8 @@ sub req_create_accounts {
)
if
!
$email
;
)
if
!
$email
;
my
$token
=
AccountManager::
Token
->
new
(
my
$token
=
AccountManager::
Token
->
new
(
db
=>
$self
->
{
db
},
db
=>
$self
->
{
db
},
token
=>
$token_secret
secret
=>
$token_secret
);
);
$self
->
abort
(
$self
->
abort
(
...
@@ -622,7 +622,7 @@ sub req_create_accounts {
...
@@ -622,7 +622,7 @@ sub req_create_accounts {
sp_entityid
=>
$entityid
,
sp_entityid
=>
$entityid
,
creation_date
=>
DateTime
->
now
(),
creation_date
=>
DateTime
->
now
(),
expiration_date
=>
DateTime
->
now
()
->
add
(
hours
=>
$validity_period
),
expiration_date
=>
DateTime
->
now
()
->
add
(
hours
=>
$validity_period
),
token
=>
AccountManager::Tools::
generate_secret
(
20
)
secret
=>
AccountManager::Tools::
generate_secret
(
20
)
);
);
$self
->
abort
(
$self
->
abort
(
...
@@ -642,7 +642,7 @@ sub req_create_accounts {
...
@@ -642,7 +642,7 @@ sub req_create_accounts {
password
=>
$password
,
password
=>
$password
,
password_crypt
=>
AccountManager::Tools::
encrypt
(
$password
,
$key
),
password_crypt
=>
AccountManager::Tools::
encrypt
(
$password
,
$key
),
password_hash
=>
AccountManager::Tools::
sha256_hash
(
$password
),
password_hash
=>
AccountManager::Tools::
sha256_hash
(
$password
),
token
=>
$download_token
->
token
(),
token
=>
$download_token
->
secret
(),
creation_date
=>
DateTime
->
now
(),
creation_date
=>
DateTime
->
now
(),
expiration_date
=>
DateTime
->
now
()
->
add
(
days
=>
$validity_period
)
expiration_date
=>
DateTime
->
now
()
->
add
(
days
=>
$validity_period
)
);
);
...
@@ -690,7 +690,7 @@ sub req_create_accounts {
...
@@ -690,7 +690,7 @@ sub req_create_accounts {
entityid
=>
$entityid
,
entityid
=>
$entityid
,
email
=>
$email
,
email
=>
$email
,
key
=>
$key
,
key
=>
$key
,
token
=>
$download_token
->
token
(),
token
=>
$download_token
->
secret
(),
days
=>
$validity_period
,
days
=>
$validity_period
,
}
}
);
);
...
@@ -722,8 +722,8 @@ sub req_download_accounts {
...
@@ -722,8 +722,8 @@ sub req_download_accounts {
)
if
!
$key
;
)
if
!
$key
;
my
$token
=
AccountManager::
Token
->
new
(
my
$token
=
AccountManager::
Token
->
new
(
db
=>
$self
->
{
db
},
db
=>
$self
->
{
db
},
token
=>
$token_secret
secret
=>
$token_secret
);
);
$self
->
abort
(
$self
->
abort
(
...
@@ -756,7 +756,7 @@ sub req_download_accounts {
...
@@ -756,7 +756,7 @@ sub req_download_accounts {
my
$accounts
=
AccountManager::
Account
->
get_accounts
(
my
$accounts
=
AccountManager::
Account
->
get_accounts
(
db
=>
$self
->
{
db
},
db
=>
$self
->
{
db
},
query
=>
[
query
=>
[
token
=>
$
self
->
{
in
}
->
{
token
}
token
=>
$
token_secret
],
],
);
);
...
...
This diff is collapsed.
Click to expand it.
lib/AccountManager/Token.pm
+
3
−
3
View file @
5c185edc
...
@@ -12,7 +12,7 @@ __PACKAGE__->meta->setup(
...
@@ -12,7 +12,7 @@ __PACKAGE__->meta->setup(
columns
=>
[
columns
=>
[
id
=>
{
type
=>
'
bigserial
',
not_null
=>
1
},
id
=>
{
type
=>
'
bigserial
',
not_null
=>
1
},
token
=>
{
type
=>
'
varchar
',
length
=>
50
,
not_null
=>
1
},
token
=>
{
type
=>
'
varchar
',
length
=>
50
,
not_null
=>
1
,
alias
=>
'
secret
'
},
email_address
=>
{
type
=>
'
varchar
',
length
=>
200
,
not_null
=>
1
},
email_address
=>
{
type
=>
'
varchar
',
length
=>
200
,
not_null
=>
1
},
sp_entityid
=>
{
type
=>
'
varchar
',
length
=>
200
,
not_null
=>
1
},
sp_entityid
=>
{
type
=>
'
varchar
',
length
=>
200
,
not_null
=>
1
},
creation_date
=>
{
type
=>
'
datetime
'
},
creation_date
=>
{
type
=>
'
datetime
'
},
...
@@ -34,9 +34,9 @@ sub print {
...
@@ -34,9 +34,9 @@ sub print {
$fd
=
\
*STDOUT
unless
$fd
;
$fd
=
\
*STDOUT
unless
$fd
;
printf
$fd
printf
$fd
"
Token ID=%s;
token
=%s; email_address=%s; sp_entityid=%s; creation_date=%s; expiration_date=%s
\n
",
"
Token ID=%s;
secret
=%s; email_address=%s; sp_entityid=%s; creation_date=%s; expiration_date=%s
\n
",
$self
->
id
(),
$self
->
id
(),
$self
->
token
(),
$self
->
secret
(),
$self
->
email_address
(),
$self
->
email_address
(),
$self
->
sp_entityid
(),
$self
->
sp_entityid
(),
$self
->
creation_date
()
->
strftime
('
%Y:%m:%d %H:%M
'),
$self
->
creation_date
()
->
strftime
('
%Y:%m:%d %H:%M
'),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment