ldap_lookup 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54e681b1bce31406239c47dabe8b8576f91d46a58a4135d2a79784ea1bae797c
4
- data.tar.gz: ba9ad988d4aec0a991094a291e3e96baabcff1c6b6ffce053a76cab886fec10a
3
+ metadata.gz: 174f93602c6a5158d0f3cce5d846eff7d2718eae02dc41eab13c843afadf86c8
4
+ data.tar.gz: 3d3de4dd9b981317460607a807b1a1fc0ceb38aa89dbe18fcd97e6aedab8c661
5
5
  SHA512:
6
- metadata.gz: 3fc6512631937a7c645ac3831c15accc99a3b45d84574e56ed9eaeacf205ecd32add060383e1b6718c8238845f8927517deefc7fef017df429c8f8c7c59760f5
7
- data.tar.gz: b80445a8398c8030e4eb42907f3a796f4829c5bb958b7839f8c3df9a9a09725276f67a71a520eba2df61d398aeb6a66a676f142a1b2ccb825a75ec37345d9a71
6
+ metadata.gz: 8f483e5246550e3aad01cb1185878b44fd7420cdb90d1b7c9126b5067e19fb6b812bbe4f448aa7144b09a8b1bd1fb998c25b281cb98d3b782745b107b8615ea6
7
+ data.tar.gz: e19cad4c0c17d93c30cfcbd7e1be5f43bbffe49a0e50bcf836938285994866c93a5dbcbeeac03f3c745d50caac996f1521616227a1f3ddcbe0854556cc72f073
@@ -0,0 +1,11 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "" # See documentation for possible values
9
+ directory: "/" # Location of package manifests
10
+ schedule:
11
+ interval: "weekly"
@@ -0,0 +1,76 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ "master" ]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: [ "master" ]
20
+ schedule:
21
+ - cron: '24 23 * * 2'
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
31
+
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ language: [ 'ruby' ]
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
+ # Use only 'java' to analyze code written in Java, Kotlin or both
38
+ # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
39
+ # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
40
+
41
+ steps:
42
+ - name: Checkout repository
43
+ uses: actions/checkout@v3
44
+
45
+ # Initializes the CodeQL tools for scanning.
46
+ - name: Initialize CodeQL
47
+ uses: github/codeql-action/init@v2
48
+ with:
49
+ languages: ${{ matrix.language }}
50
+ # If you wish to specify custom queries, you can do so here or in a config file.
51
+ # By default, queries listed here will override any specified in a config file.
52
+ # Prefix the list here with "+" to use these queries and those in the config file.
53
+
54
+ # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
55
+ # queries: security-extended,security-and-quality
56
+
57
+
58
+ # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
59
+ # If this step fails, then you should remove it and run the build manually (see below)
60
+ - name: Autobuild
61
+ uses: github/codeql-action/autobuild@v2
62
+
63
+ # ℹ️ Command-line programs to run using the OS shell.
64
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
65
+
66
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
67
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
68
+
69
+ # - run: |
70
+ # echo "Run, Build Application using script"
71
+ # ./location_of_script_within_repo/buildscript.sh
72
+
73
+ - name: Perform CodeQL Analysis
74
+ uses: github/codeql-action/analyze@v2
75
+ with:
76
+ category: "/language:${{matrix.language}}"
@@ -0,0 +1,45 @@
1
+ name: Ruby Gem
2
+
3
+ on:
4
+ push:
5
+ branches: [ "master" ]
6
+ pull_request:
7
+ branches: [ "master" ]
8
+
9
+ jobs:
10
+ build:
11
+ name: Build + Publish
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: read
15
+ packages: write
16
+
17
+ steps:
18
+ - uses: actions/checkout@v3
19
+ - name: Set up Ruby 2.6
20
+ uses: actions/setup-ruby@v1
21
+ with:
22
+ ruby-version: 2.6.x
23
+
24
+ - name: Publish to GPR
25
+ run: |
26
+ mkdir -p $HOME/.gem
27
+ touch $HOME/.gem/credentials
28
+ chmod 0600 $HOME/.gem/credentials
29
+ printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
30
+ gem build *.gemspec
31
+ gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
32
+ env:
33
+ GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
34
+ OWNER: ${{ github.repository_owner }}
35
+
36
+ - name: Publish to RubyGems
37
+ run: |
38
+ mkdir -p $HOME/.gem
39
+ touch $HOME/.gem/credentials
40
+ chmod 0600 $HOME/.gem/credentials
41
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
42
+ gem build *.gemspec
43
+ gem push *.gem
44
+ env:
45
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ldap_lookup (0.1.5)
4
+ ldap_lookup (0.1.7)
5
5
  net-ldap (~> 0.17.0)
6
6
 
7
7
  GEM
@@ -1,3 +1,3 @@
1
1
  module LdapLookup
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
data/lib/ldap_lookup.rb CHANGED
@@ -52,13 +52,12 @@ module LdapLookup
52
52
  # Build filter
53
53
  search_filter = Net::LDAP::Filter.eq("uid", search_param)
54
54
  # Execute search
55
- ldap.search(filter: search_filter, attributes: result_attrs) { |item|
56
- begin
57
- return item.displayName.first
58
- rescue
59
- return "not available"
55
+ result = ldap.search(filter: search_filter, attributes: result_attrs)
56
+ if result.length != 0
57
+ return result.first.displayname.first
58
+ else
59
+ return "No such user"
60
60
  end
61
- }
62
61
  get_ldap_response(ldap)
63
62
  end
64
63
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ldap_lookup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Smoke
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-20 00:00:00.000000000 Z
11
+ date: 2023-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -75,6 +75,9 @@ executables: []
75
75
  extensions: []
76
76
  extra_rdoc_files: []
77
77
  files:
78
+ - ".github/dependabot.yml"
79
+ - ".github/workflows/codeql.yml"
80
+ - ".github/workflows/gem-push.yml"
78
81
  - ".gitignore"
79
82
  - CODE_OF_CONDUCT.md
80
83
  - Gemfile