项目作者: ps78674

项目描述 :
高级语言: Go
项目地址: git://github.com/ps78674/libnss-http.go.git
创建时间: 2020-12-02T13:19:44Z
项目社区:https://github.com/ps78674/libnss-http.go

开源协议:

下载



NSS library written in golang will not work properly because of a fork() in parent. Go runtime is asynchronous and forking such a process is impossible.
This code hangs on goroutine in net.Dial().


NSS module for rest/http.

Configureation\
/etc/nsswitch.conf:

  1. passwd: compat http
  2. group: compat http
  3. shadow: compat http

/etc/nsshttp.conf:

  1. HTTPSERVER=https://si.rd.aorti.ru/api/nss
  2. TIMEOUT=3
  3. #DEBUG=true

Endpoints\
/passwd

  1. [
  2. {
  3. "pw_name": "iivanov",
  4. "pw_passwd": "x",
  5. "pw_uid": 1111,
  6. "pw_gid": 2222,
  7. "pw_gecos": "Ivan Ivanov",
  8. "pw_dir": "/home/iivanov",
  9. "pw_shell": "/bin/bash"
  10. }
  11. ]

/shadow

  1. [
  2. {
  3. "sp_namp": "iivanov",
  4. "sp_pwdp": "0000000000000000000000000000000000000000000000000000000",
  5. "sp_lstchg": 12345,
  6. "sp_min": 0,
  7. "sp_max": 99999,
  8. "sp_warn": 7,
  9. "sp_inact": null,
  10. "sp_expire": null,
  11. "sp_flag": null
  12. }
  13. ]

/group

  1. [
  2. {
  3. "gr_name": "admins",
  4. "gr_passwd": "x",
  5. "gr_gid": 3333,
  6. "gr_mem": [
  7. "iivanov"
  8. ]
  9. }
  10. ]